ocx必须在客户端进行注册 然后用vi编辑的时候加进去就可以了。 http://c.lstc.edu.cn:8888/vb/vbdoc/ocx/english/ 这里有很多有很多dll,ocx制作的资料,你去看看吧,我上传不了东西,郁闷啊 This ActiveX DLL (Source Included) shows how to create animated dialogs in VB5. 演示怎样动态创建一个对话框(Active DLL VB5.0) An OCX that allows you to make quality slideshow picture presentations 一个使你制作高质量幻灯片的OCX控件
vb调用ocx sapBO = oBAPICtrl.GetSAPObject("ZProdOrderStatus") If Err.Number <> 0 Then MsgBox("No local BO 'ZProdOrderStatus' created!", 16, APPID) Exit Function End If 'Default Input data If Len(txtAUFNR.Text) = 0 Then txtAUFNR.Text = "*" If Len(txtLanguage.Text) = 0 Then txtLanguage.Text = "ZH"o = oBAPICtrl.DimAs(sapBO, "ZGetOrderStatus", "BapiOrderStatusImport") oStat = oBAPICtrl.DimAs(sapBO, "ZGetOrderStatus", "TBapistat")o.Value("ORDERID") = txtAUFNR.Text o.Value("I_SPRAS") = txtLanguage.Text o.Value("I_ExcludeInactive") = txtExc.TextsapBO.ZGetOrderStatus(BapiOrderStatusImport:=o, _ TBapistat:=oStat, _ Return:=oReturn) 'handling errors at the remote call and checking the return code If Not oReturn Is Nothing Then If oReturn("Type") <> "" And oReturn("Type") <> "S" Then MsgBox(oReturn("Type") + oReturn("Code") _ + vbCrLf + oReturn("Message"), vbOKOnly, APPID) Exit Function End If End If GetList = True Call ShowData()
龙行天上,你这是C/S的代码,贴这里说明什么呢,在asp.net里如何调用
跟控件一样的.把那个xx.ocx 文件,拖到你想放的地方就行了
asp.net里还可以用*.ocx吗?我的这个是*.dll的 通过引用,在com项中增加,这是我以前vbs的可以调用,我现在想用后台调,出现了一些问题:Partial Class _Default Inherits System.Web.UI.Page Public WithEvents TEInformationWindow1 As TERRAEXPLORERXLib.TEInformationWindow Public WithEvents TE3DWindow1 As TERRAEXPLORERXLib.TE3DWindow Dim WithEvents TE As TerraExplorerLib.TerraExplorer Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ' TE = New TerraExplorerLib.TerraExplorer ' TE.Load("d:\体育场馆注记.FLY") End Sub End Class下面是vbs 问题1 <OBJECT ccccc /OBJECT>是不是客户端的activex,除了用vbs之外可以用vb.net吗,我上面的vb.net有什么问题? 问题2 如果只以用vbs,那么activex的属性如何在不刷新页面的情况下,传至后台的vb.net变量中 问题3 vbs脚本不想让人看到 ================================================================================== <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <script language="vbscript">
sub OpenFly()
set ITerraExplorer3=TE.interface("ITerraExplorer3") set IRender4=TE.interface("IRender4") if filename="" then msgbox "请选择正确的项目!" exit sub else 'E:\share\Default.fly http://sky-lb/huzhou/default.fly ITerraExplorer3.LoadEx "d:\体育场馆注记.FLY","","",false Set SelectedNavMode = NavTurn filename="" end if end sub
set ITerraExplorer3=TE.interface("ITerraExplorer3") set IRender4=TE.interface("IRender4") ITerraExplorer3.LoadEx "E:\share\\Default.fly","","",false 'Set SelectedNavMode = NavTurn filename=""
end sub
sub GetPosition() Set IPlane4 = TE.interface("IPlane4")
IPlane4.GetPosition X, Y, Height, Yaw, Pitch, Roll, CameraDeltaYaw, CameraDeltaPitch 'At this point, we have the plane position. 'Do something with it (i.e. connect to a server to find the nearest movie theater). 'In this sample, simply display it in a message box. Msgbox "Plane position: " & X & "," & Y & "," & Height Msgbox "Plane orientation: " & Yaw & "," & Pitch & "," & Roll Msgbox "Camera offset: " & CameraDeltaYaw & "," & CameraDeltaPitch end sub sub SetPosition() Set IPlane4 = TE.interface("IPlane4") IPlane4.GetPosition X, Y, Height, Yaw, Pitch, Roll, CameraDeltaYaw, CameraDeltaPitch IPlane4.SetPosition 1000, 1000, 1000, 0, 0, 0, 0, 0, 3320 end sub sub FlyTo() Set IPlane4= TE.interface("IPlane3") IPlane4.FlyTo 946672.31, 2113310.65, 2000, 100, 0, 0, "FlyToTerrain" end sub
sub test() set IPlane4 = nothing set ITerraExplorer3 = nothing end sub
然后用vi编辑的时候加进去就可以了。
http://c.lstc.edu.cn:8888/vb/vbdoc/ocx/english/
这里有很多有很多dll,ocx制作的资料,你去看看吧,我上传不了东西,郁闷啊
This ActiveX DLL (Source Included) shows how to create animated dialogs in VB5. 演示怎样动态创建一个对话框(Active DLL VB5.0)
An OCX that allows you to make quality slideshow picture presentations 一个使你制作高质量幻灯片的OCX控件
sapBO = oBAPICtrl.GetSAPObject("ZProdOrderStatus")
If Err.Number <> 0 Then
MsgBox("No local BO 'ZProdOrderStatus' created!", 16, APPID)
Exit Function
End If
'Default Input data
If Len(txtAUFNR.Text) = 0 Then txtAUFNR.Text = "*"
If Len(txtLanguage.Text) = 0 Then txtLanguage.Text = "ZH"o = oBAPICtrl.DimAs(sapBO, "ZGetOrderStatus", "BapiOrderStatusImport")
oStat = oBAPICtrl.DimAs(sapBO, "ZGetOrderStatus", "TBapistat")o.Value("ORDERID") = txtAUFNR.Text
o.Value("I_SPRAS") = txtLanguage.Text
o.Value("I_ExcludeInactive") = txtExc.TextsapBO.ZGetOrderStatus(BapiOrderStatusImport:=o, _
TBapistat:=oStat, _
Return:=oReturn)
'handling errors at the remote call and checking the return code
If Not oReturn Is Nothing Then
If oReturn("Type") <> "" And oReturn("Type") <> "S" Then
MsgBox(oReturn("Type") + oReturn("Code") _
+ vbCrLf + oReturn("Message"), vbOKOnly, APPID)
Exit Function
End If
End If
GetList = True
Call ShowData()
通过引用,在com项中增加,这是我以前vbs的可以调用,我现在想用后台调,出现了一些问题:Partial Class _Default
Inherits System.Web.UI.Page
Public WithEvents TEInformationWindow1 As TERRAEXPLORERXLib.TEInformationWindow
Public WithEvents TE3DWindow1 As TERRAEXPLORERXLib.TE3DWindow
Dim WithEvents TE As TerraExplorerLib.TerraExplorer Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' TE = New TerraExplorerLib.TerraExplorer
' TE.Load("d:\体育场馆注记.FLY")
End Sub
End Class下面是vbs
问题1 <OBJECT ccccc /OBJECT>是不是客户端的activex,除了用vbs之外可以用vb.net吗,我上面的vb.net有什么问题?
问题2 如果只以用vbs,那么activex的属性如何在不刷新页面的情况下,传至后台的vb.net变量中
问题3 vbs脚本不想让人看到
==================================================================================
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<script language="vbscript">
sub OpenFly()
set ITerraExplorer3=TE.interface("ITerraExplorer3")
set IRender4=TE.interface("IRender4")
if filename="" then
msgbox "请选择正确的项目!"
exit sub
else
'E:\share\Default.fly http://sky-lb/huzhou/default.fly
ITerraExplorer3.LoadEx "d:\体育场馆注记.FLY","","",false
Set SelectedNavMode = NavTurn
filename=""
end if
end sub
sub initfly()
' MapControl1_divLoading.style.visibility = "visible"
' TE3DWindow1.style.zIndex = 1000
' parent.fr1.MapControl1_divLoading.style.visibility = "visible"
' TE3DWindow1.style.visibility = "hidden"
set ITerraExplorer3=TE.interface("ITerraExplorer3")
set IRender4=TE.interface("IRender4")
ITerraExplorer3.LoadEx "E:\share\\Default.fly","","",false
'Set SelectedNavMode = NavTurn
filename=""
end sub
sub GetPosition() Set IPlane4 = TE.interface("IPlane4")
IPlane4.GetPosition X, Y, Height, Yaw, Pitch, Roll, CameraDeltaYaw, CameraDeltaPitch 'At this point, we have the plane position. 'Do something with it (i.e. connect to a server to find the nearest movie theater). 'In this sample, simply display it in a message box. Msgbox "Plane position: " & X & "," & Y & "," & Height Msgbox "Plane orientation: " & Yaw & "," & Pitch & "," & Roll Msgbox "Camera offset: " & CameraDeltaYaw & "," & CameraDeltaPitch end sub sub SetPosition() Set IPlane4 = TE.interface("IPlane4") IPlane4.GetPosition X, Y, Height, Yaw, Pitch, Roll, CameraDeltaYaw, CameraDeltaPitch
IPlane4.SetPosition 1000, 1000, 1000, 0, 0, 0, 0, 0, 3320 end sub sub FlyTo()
Set IPlane4= TE.interface("IPlane3")
IPlane4.FlyTo 946672.31, 2113310.65, 2000, 100, 0, 0, "FlyToTerrain" end sub
sub test()
set IPlane4 = nothing
set ITerraExplorer3 = nothing
end sub
'initfly() </script>
<title>无标题页</title>
</head>
<body onload="initfly()" onunload="test()">
<form id="form1" runat="server">
<div>
</div>
</form>
<OBJECT id="Teinformationwindow1" style="Z-INDEX: 103; LEFT: 552px; WIDTH: 200px; POSITION: absolute; TOP: 16px; HEIGHT: 336px"
classid="clsid:3A4F9193-65A8-11D5-85C1-0001023952C1" >
<PARAM NAME="_cx" VALUE="6138">
<PARAM NAME="_cy" VALUE="8890">
<PARAM NAME="BackColor" VALUE="0">
<PARAM NAME="BorderStyle" VALUE="3">
<PARAM NAME="ForeColor" VALUE="0">
<PARAM NAME="Text" VALUE="">
</OBJECT>
<OBJECT id="TE3DWindow1" style="WIDTH: 528px; HEIGHT: 424px; z-index: 104; left: 16px; position: absolute; top: 16px;" classid="clsid:3A4F9192-65A8-11D5-85C1-0001023952C1"
name="TE3DWindow1" >
<PARAM NAME="_cx" VALUE="16298">
<PARAM NAME="_cy" VALUE="16828">
<PARAM NAME="BackColor" VALUE="0">
<PARAM NAME="BorderStyle" VALUE="3">
<PARAM NAME="Caption" VALUE="">
<PARAM NAME="ForeColor" VALUE="0">
<PARAM NAME="Text" VALUE="">
</OBJECT>
<OBJECT id="TE" style="Z-INDEX: 101; LEFT: 576px; POSITION: absolute; TOP: 376px" classid="CLSID:3a4f9191-65a8-11d5-85c1-0001023952c1" > </OBJECT>
</body>
</html>