E
eddie
Hi, my colleague wrote a scriptlet to get server wide environment variables
from ASP. However, my web application is written by C#, and I try to write a
program to access that COM but I always get a error. How can I solve this
problem? Any solution? Thanks!
An unhandled exception of type 'System.InvalidCastException' occurred in
mscorlib.dll
Additional information: QueryInterface for interface
ScriptletTypeLib.Automation failed.
ScriptletTypeLib.ASPEnvClass ASPEnv = new ScriptletTypeLib.ASPEnvClass();
Console.WriteLine(ASPEnv.GetItem().ToString());
<?XML version="1.0"?>
<package>
<?component error="true" debug="true"?>
<comment>
A script component to provide server wide environment variables
</comment>
<component id="ASPEnv">
<registration
progid="ASPEnv"
description="ASP Server-wdie Environment Variables"
version="1"
clsid="{BFCB53B7-6D17-4125-93BD-EB7FB18845F4}"/>
<public>
<method name="GetItem" />
</public>
<script language="VBScript">
<![CDATA[
Function GetItem()
GetItem = "hello"
End Function
]]>
</script>
</component>
</package>
from ASP. However, my web application is written by C#, and I try to write a
program to access that COM but I always get a error. How can I solve this
problem? Any solution? Thanks!
An unhandled exception of type 'System.InvalidCastException' occurred in
mscorlib.dll
Additional information: QueryInterface for interface
ScriptletTypeLib.Automation failed.
ScriptletTypeLib.ASPEnvClass ASPEnv = new ScriptletTypeLib.ASPEnvClass();
Console.WriteLine(ASPEnv.GetItem().ToString());
<?XML version="1.0"?>
<package>
<?component error="true" debug="true"?>
<comment>
A script component to provide server wide environment variables
</comment>
<component id="ASPEnv">
<registration
progid="ASPEnv"
description="ASP Server-wdie Environment Variables"
version="1"
clsid="{BFCB53B7-6D17-4125-93BD-EB7FB18845F4}"/>
<public>
<method name="GetItem" />
</public>
<script language="VBScript">
<![CDATA[
Function GetItem()
GetItem = "hello"
End Function
]]>
</script>
</component>
</package>