473,385 Members | 1,942 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,385 software developers and data experts.

System.__ComObject is not what I want returned

les
I have a c# class that I want to work, when compiled into a dll,
either in asp.net or classic asp 3.0. It references
System.EnterpriseServices and ASPTypeLibrary and as far as the dll
used either an asp.net page or an asp page goes, it functions, apart
from the following part which is meant to gather, for logging,
request.servervariable objects When called by an asp page they return
the string System.__ComObject instead of an i.p. address or part of a
url.

This is the code:

if(System.Web.HttpContext.Current != null)
{
//the calling page is aspx
string address_remote =
System.Web.HttpContext.Current.Request.ServerVaria bles["REMOTE_ADDR"].ToString().Trim();

strRequest += "\t" + address_remote;
strRequest += "\t" +
System.Web.HttpContext.Current.Request.ServerVaria bles["SCRIPT_NAME"].ToString();
}
else
{
// the calling page is classic asp

ASPTypeLibrary.Request oRequest =
(ASPTypeLibrary.Request)ContextUtil.GetNamedProper ty("Request");
if(oRequest as ASPTypeLibrary.Request == null)
{
//this never gets executed, so oRequest is not null
strRequest += "xxx.xxx.xxx.xxx";
strRequest += "\t/path1/path2/dummy.asp";
}
else
{
//the next two become "System.__ComObject"

string address_remote =
oRequest.ServerVariables["REMOTE_ADDR"].ToString();

strRequest += "\t" + address_remote;
strRequest += "\t" +
oRequest.ServerVariables["SCRIPT_NAME"].ToString();
}
}

How can I get the actual values of what would in classic asp be
Request.ServerVariables("REMOTE_ADDR") and
Request.ServerVariables("SCRIPT_NAME")?

May 30 '07 #1
2 7410
I made a test in classic ASP and was it returns actually an IStringList
object. So try perhaps ServerVariables["SomeVar"].Item(1).ToString().

--
Patrice

"les" <le*********@gmail.coma écrit dans le message de news:
11**********************@p47g2000hsd.googlegroups. com...
>I have a c# class that I want to work, when compiled into a dll,
either in asp.net or classic asp 3.0. It references
System.EnterpriseServices and ASPTypeLibrary and as far as the dll
used either an asp.net page or an asp page goes, it functions, apart
from the following part which is meant to gather, for logging,
request.servervariable objects When called by an asp page they return
the string System.__ComObject instead of an i.p. address or part of a
url.

This is the code:

if(System.Web.HttpContext.Current != null)
{
//the calling page is aspx
string address_remote =
System.Web.HttpContext.Current.Request.ServerVaria bles["REMOTE_ADDR"].ToString().Trim();

strRequest += "\t" + address_remote;
strRequest += "\t" +
System.Web.HttpContext.Current.Request.ServerVaria bles["SCRIPT_NAME"].ToString();
}
else
{
// the calling page is classic asp

ASPTypeLibrary.Request oRequest =
(ASPTypeLibrary.Request)ContextUtil.GetNamedProper ty("Request");
if(oRequest as ASPTypeLibrary.Request == null)
{
//this never gets executed, so oRequest is not null
strRequest += "xxx.xxx.xxx.xxx";
strRequest += "\t/path1/path2/dummy.asp";
}
else
{
//the next two become "System.__ComObject"

string address_remote =
oRequest.ServerVariables["REMOTE_ADDR"].ToString();

strRequest += "\t" + address_remote;
strRequest += "\t" +
oRequest.ServerVariables["SCRIPT_NAME"].ToString();
}
}

How can I get the actual values of what would in classic asp be
Request.ServerVariables("REMOTE_ADDR") and
Request.ServerVariables("SCRIPT_NAME")?

May 30 '07 #2
les
On May 30, 5:30 pm, "Patrice" <http://www.chez.com/scribe/wrote:
I made a test in classic ASP and was it returns actually an IStringList
object. So try perhaps ServerVariables["SomeVar"].Item(1).ToString().

--
Patrice

"les" <lesliewb...@gmail.coma écrit dans le message de news:
1180539662.129762.227...@p47g2000hsd.googlegroups. com...
I have a c# class that I want to work, when compiled into a dll,
either in asp.net or classic asp 3.0. It references
System.EnterpriseServices and ASPTypeLibrary and as far as the dll
used either an asp.net page or an asp page goes, it functions, apart
from the following part which is meant to gather, for logging,
request.servervariable objects When called by an asp page they return
the string System.__ComObject instead of an i.p. address or part of a
url.
This is the code:
if(System.Web.HttpContext.Current != null)
{
//the calling page is aspx
string address_remote =
System.Web.HttpContext.Current.Request.ServerVaria bles["REMOTE_ADDR"].ToStr*ing().Trim();
strRequest += "\t" + address_remote;
strRequest += "\t" +
System.Web.HttpContext.Current.Request.ServerVaria bles["SCRIPT_NAME"].ToStr*ing();
}
else
{
// the calling page is classic asp
ASPTypeLibrary.Request oRequest =
(ASPTypeLibrary.Request)ContextUtil.GetNamedProper ty("Request");
if(oRequest as ASPTypeLibrary.Request == null)
{
//this never gets executed, so oRequest is not null
strRequest += "xxx.xxx.xxx.xxx";
strRequest += "\t/path1/path2/dummy.asp";
}
else
{
//the next two become "System.__ComObject"
string address_remote =
oRequest.ServerVariables["REMOTE_ADDR"].ToString();
strRequest += "\t" + address_remote;
strRequest += "\t" +
oRequest.ServerVariables["SCRIPT_NAME"].ToString();
}
}
How can I get the actual values of what would in classic asp be
Request.ServerVariables("REMOTE_ADDR") and
Request.ServerVariables("SCRIPT_NAME")?- Hide quoted text -

- Show quoted text -
Thank you very much! What I actually works now is just slightly
different,

strRequest = ((IStringList)oRequest.ServerVariables["SCRIPT_NAME"])
[1].ToString();

which I found on
http://www.velocityreviews.com/forum...net-class.html
with a search inspired by your post. Thanks again

Les

Jun 1 '07 #3

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

Similar topics

0
by: Angelos Karantzalis | last post by:
Hi y'all, here's a tricky one: I've written a wrapper around a Com Interop-generated assembly in C#. It's called SDEHandler & implements a previously defined interface, so that I can use it as a...
0
by: Fidias Gil de Montes | last post by:
In a Distributed Windows application, I receive the following message when the client calls the server: ************** Exception Text ************** System.InvalidCastException: Unable to cast...
3
by: Axel Strube-Zettler | last post by:
I'm stuck now for a whole afternoon with a little Interop problem: static object m_ovl = m_app.GetInterfaceObject("VL.Application.nn"); (m_app.GetInterfaceObject() returns the in-process VL...
2
by: Ron Dahl | last post by:
In Word VBA the expression "ActiveDocument.Paragraphs(1).Style returns "Heading 3" In VB.Net the expression "appWord.ActiveDocument.Paragraphs(1).Style" returns "{System.__ComObject} :...
2
by: stunt016 | last post by:
I have a program written in C# that handles communication between two pieces of software. My problem only deals with getting a text array from one program to this C# "Bridge". I can get the text...
6
by: Mark Rae | last post by:
Hi, I'm in the process of updating an ASP.NET v1.1 web app to v2. The app uses ActiveDirectory a great deal, and I'm trying to use the new System.Collections.Generic namespace where possible,...
0
by: woollymammoth | last post by:
I can't assign a MS SQL Server table record value to a simple VB variable, should be an easy thing. Sample SQL Server table has the data in the record as a char(30) string, the column for that record...
1
by: woollymammoth | last post by:
I can't assign a MS SQL Server table record value to a simple VB variable, should be a really easy thing. Sample SQL Server table has the data in the record as a char(30) string, the column for that...
2
by: Bigi | last post by:
Hi, Please help, this has been driving me nuts for nearly 2 days now. This vb6 code works: Public oEng As New ebizEngine Public oMsg As ebizMessage Function EbizGetFromQueue() As String
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.