473,383 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Getting intrinsic classic ASP object properties

I need to access classic ASP intrinsic objects and their properties from a
..net assembly wrapped to COM. The COM .net assembly is then instanciated from
a classic ASP page with Server.CreateObject().

I'm trying to use the Microsoft Transaction Server this way:

Type typeMtx = Type.GetTypeFromProgID("MTxAS.AppServer.1");
object mtxobject = Activator.CreateInstance(typeMtx);

// Getting classic ASP object context
object context = typeMtx.InvokeMember("GetObjectContext",
BindingFlags.InvokeMethod, null, mtxobject, null);

// Getting Request property
String strindex = "Request";
object myrequest = context.GetType().InvokeMember("Item",
BindingFlags.GetProperty, null, context, new object[] {strindex});

// Test: trying to get the TotalBytes property of Request. This seems
// to work, since something is returned ("0")
String totalbytes = myrequest.GetType().InvokeMember("TotalBytes",
BindingFlags.GetProperty, null, myrequest, new object[] { }).ToString();

// Getting the ServerVariables collection
object servervariables = myrequest.GetType().InvokeMember("ServerVariables" ,
BindingFlags.Default | BindingFlags.GetProperty, null, myrequest, new
object[] { });

// Getting the URL entry from ServerVariables
strindex = "URL";
object URLProp = servervariables.GetType().InvokeMember("Item",
BindingFlags.Default | BindingFlags.InvokeMethod, null, servervariables,
new object[] { strindex });

// Trying to read value
String url = typeURLProp.InvokeMember("Value",
BindingFlags.Default | BindingFlags.GetProperty, null, URLProp, new
object[] { });

When trying to read the "Value" of the "URL" ServerVariables entry, I get
this error:

HRESULT 0x80020006 (DISP_E_UNKNOWNNAME)

I've been trying to sort this out for one day, it seems all perfectly
logical to me, what am I doing wrong?

Fabrizio

Jul 2 '08 #1
0 1685

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Amir Hardon | last post by:
I am dynamically adding rows to a table, and each row have a button which removes it. I have successfully implemented this for mozilla but I'm having troubles with IE, here is how I did it: ...
6
by: Ken Kast | last post by:
Here's my situation. I have an object function Obj () { this.foo = null; } a function function bar() {...} another function
13
by: Alek Davis | last post by:
Hi, Is it possible to access intrinsic ASP objects, such as Request, from a .NET class. Say, I have a .NET library exposed via a COM or COM+ wrapper. Can this library retrieve the request info...
5
by: Alan Ho | last post by:
What are intrinsic objects of asp.net? thx
4
by: Chris Ashley | last post by:
I have a class called App set as the startup object with the following code: Friend Class App Shared Sub Main() Dim FrmMain As New MainForm Application.Run(FrmMain) End Sub End Class In...
0
by: Alexander | last post by:
Stituation: ----------------------- 1) COM+ application with .NET components (using regasm, interfaces etc.) 2) ASP (classic) creates an instance of a object using Server.CreateObject. The...
2
by: jason | last post by:
hello everyone, i have had a suppot ticket open with microsoft for some time to investigate a memory leak issue we are experiencing on our production web servers. the web servers host both ASP...
5
by: mike | last post by:
Hi, I have been playing with VB.NET/C# for getting some general properties of a fileinfo object. However, FileInfo object does not seem to expose some of the basic properties like TYPE that used...
33
by: JamesB | last post by:
I am writing a service that monitors when a particular app is started. Works, but I need to get the user who is currently logged in, and of course Environment.UserName returns the service logon...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.