积极答复者
asp代码转换问题

问题
-
有一個asp頁面中有asp代碼:
Set Fns=CreateObject("aaa.Functions")
Set con=Fns.Connection
Fns.LogLevel=0
con.ApplicationServer="111.123.11.11"
con.System="1"
con.User="user"
con.Password="pass"
con.Client="100"con.Language=" "
con.HostName="111.123.11.11"
con.MessageServer="111.123.11.11"
con.SystemNumber="1"R3conn.TraceLevel=6
現在想改成aspx頁面。同时想寫入後臺vb.net代碼頁中。而不是在前台页面中直接写。
不知道如何轉換。請教各位。謝謝
nn
答案
-
Hello,
>>現在想改成aspx頁面。同时想寫入後臺vb.net代碼頁中。而不是在前台页面中直
接写。
“aaa.Functions”具体内容是什么,是个类吗?ASP里的CreateObject是用于创建一个实例的,如果是类的话,在VB里直接写:
Dim instancename as aaa.Functions =new aaa.Functions();
然后给他的properties赋值就可以了。
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- 已标记为答案 nyyswdxdcmis 2014年7月28日 4:00
全部回复
-
Hello,
>>現在想改成aspx頁面。同时想寫入後臺vb.net代碼頁中。而不是在前台页面中直
接写。
“aaa.Functions”具体内容是什么,是个类吗?ASP里的CreateObject是用于创建一个实例的,如果是类的话,在VB里直接写:
Dim instancename as aaa.Functions =new aaa.Functions();
然后给他的properties赋值就可以了。
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- 已标记为答案 nyyswdxdcmis 2014年7月28日 4:00
-
最后是这样:
Partial Class stock_stock Inherits System.Web.UI.Page Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Dim Fns As Object = CreateObject("aaa.Functions") Dim R3conn = Fns.connection R3conn.ApplicationServer = "111.111.111.11" R3conn.System = "1" R3conn.User = "xxx" R3conn.Password = "xxx" R3conn.Client = "xxx" R3conn.Language = " " R3conn.HostName = "111.111.111.11" R3conn.MessageServer = "111.111.111.11" R3conn.SystemNumber = "1" R3conn.TraceLevel = 6 End If End Sub End Class
以上是aspx页面的后台vb代码页。测试ok
aaa.functions 可能是一个sap程序的相关类吧。反正运行这个页面的环境 必须安装那个sap程序才能执行。
如果环境中不安装asp程序。此页执行会出错。提示无法创建 ActiveX 组件
nn