添加引用,“COM+ 服务类型库 (Comsvcs.dll)”和“Microsoft Active Server Pages 对象库 (Asp.dll)”。 Dim objContext As ObjectContext
Dim objResponse As Response
Dim objRequest As Request
Dim objApplication As Application
Dim objSession As Session
Set objContext = GetObjectContext()
Set objApplication = objContext("Application") 'Obtain ASP Application object.
Set objSession = objContext("Session") 'Obtain ASP Session object.
Set objResponse = objContext("Response") ' Obtain ASP Response object.
Set objRequest = objContext("Request") ' Obtain ASP Request object. 'This code uses the Response object (objResponse);
'you can use other intrinsic objects in a similar fashion.
objResponse.Write "Hello World!"
microsoft网站上找到以上在vb中使用asp内置对象的方法,但在.net中总是运行不成功。有会的吗?
void Page_Load(object sender, EventArgs e)
{
COMSVCSLib.AppServerClass ac = new COMSVCSLib.AppServerClass();
COMSVCSLib.ObjectContext oc;
oc = ac.GetObjectContext();//错误关键: oc==null
}
Dim objResponse As Response
Dim objRequest As Request
Dim objApplication As Application
Dim objSession As Session
Set objContext = GetObjectContext()
Set objApplication = objContext("Application") 'Obtain ASP Application object.
Set objSession = objContext("Session") 'Obtain ASP Session object.
Set objResponse = objContext("Response") ' Obtain ASP Response object.
Set objRequest = objContext("Request") ' Obtain ASP Request object. 'This code uses the Response object (objResponse);
'you can use other intrinsic objects in a similar fashion.
objResponse.Write "Hello World!"
microsoft网站上找到以上在vb中使用asp内置对象的方法,但在.net中总是运行不成功。有会的吗?
void Page_Load(object sender, EventArgs e)
{
COMSVCSLib.AppServerClass ac = new COMSVCSLib.AppServerClass();
COMSVCSLib.ObjectContext oc;
oc = ac.GetObjectContext();//错误关键: oc==null
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货