Showing posts with label call. Show all posts
Showing posts with label call. Show all posts

Monday, March 26, 2012

System.Net.Dns.GetHostByAddress returns incorrec t Hostame

Hi!

I have a problem with

System.Net.Dns.GetHostByAddress(ls_Request.UserHos tAddress()).HostName

Usually the call GetHostByAddress returns the correct hostname of the
client, but sometimes I get a hostname like _CERDR1342B88E.
Why? The clients are running under Windows CE.NET 4.1...

SvenSven wrote:

> Hi!
> I have a problem with
> System.Net.Dns.GetHostByAddress(ls_Request.UserHos tAddress()).HostName
> Usually the call GetHostByAddress returns the correct hostname of the
> client, but sometimes I get a hostname like _CERDR1342B88E.
> Why? The clients are running under Windows CE.NET 4.1...
> Sven

What happens if you probe a ip address that returns such a name op port 445?
Is it open? If so, the computername is returned and not the hostname.

Someone with more knowledge of the tcp/ip system could clear this out.

//Rutger
You should post this to the
microsoft.public.dotnet.framework.compactframework group.

feroze
==============
this posting is provided as-is.

"Rutger Smit" <DoDotNet@.gmail.com> wrote in message
news:10jf0rcdh7os851@.corp.supernews.com...
> Sven wrote:
> > Hi!
> > I have a problem with
> > System.Net.Dns.GetHostByAddress(ls_Request.UserHos tAddress()).HostName
> > Usually the call GetHostByAddress returns the correct hostname of the
> > client, but sometimes I get a hostname like _CERDR1342B88E.
> > Why? The clients are running under Windows CE.NET 4.1...
> > Sven
> What happens if you probe a ip address that returns such a name op port
445?
> Is it open? If so, the computername is returned and not the hostname.
> Someone with more knowledge of the tcp/ip system could clear this out.
> //Rutger
Well, the call System.Net.Dns.GetHostByAddress is executed on a
Windows 2003 Server... and i want to get the hostname of an IP address
(from a Windows CE system). I don't know if the behaviour is specific
to CE...

"Feroze [msft]" <ferozed@.online.microsoft.com> wrote in message news:<413795eb$1@.news.microsoft.com>...
> You should post this to the
> microsoft.public.dotnet.framework.compactframework group.
> feroze
> ==============
> this posting is provided as-is.
Rutger Smit <DoDotNet@.gmail.com> wrote in message news:<10jf0rcdh7os851@.corp.supernews.com>...
> Sven wrote:
> > Hi!
> > I have a problem with
> > System.Net.Dns.GetHostByAddress(ls_Request.UserHos tAddress()).HostName
> > Usually the call GetHostByAddress returns the correct hostname of the
> > client, but sometimes I get a hostname like _CERDR1342B88E.
> > Why? The clients are running under Windows CE.NET 4.1...
> > Sven
> What happens if you probe a ip address that returns such a name op port 445?
> Is it open? If so, the computername is returned and not the hostname.
> Someone with more knowledge of the tcp/ip system could clear this out.
> //Rutger

I looked up the computername on the windows ce machines, but the
computername is the one we set initialy (not _CERDR1342B88E)! But the
call System.Net.Dns.GetHostByAddress returns _CERDR1342B88E. I don't
know what the call System.Net.Dns.GetHostByAddress exactly does, but
it does not seem to be right.

Since the hostname is not really _CERDR1342B88E, i think a probe on
port 445 does not make sense...

Sven
Sven wrote:

> Rutger Smit <DoDotNet@.gmail.com> wrote in message news:<10jf0rcdh7os851@.corp.supernews.com>...
>
> I looked up the computername on the windows ce machines, but the
> computername is the one we set initialy (not _CERDR1342B88E)! But the
> call System.Net.Dns.GetHostByAddress returns _CERDR1342B88E. I don't
> know what the call System.Net.Dns.GetHostByAddress exactly does, but
> it does not seem to be right.
> Since the hostname is not really _CERDR1342B88E, i think a probe on
> port 445 does not make sense...
> Sven

It looks like GetHostByAddress does NOT always do a reverse lookup. Ik
don't know what is doe. Try to analyze the network logs that can be
caputred using Ethereal.

The port 445 suggestion was becaus of the computername, but it doens't
have anything to do with it.

//Rutger

System.Net.Dns.GetHostByAddress returns incorrec t Hostame

Hi!
I have a problem with
System.Net.Dns.GetHostByAddress(ls_Request.UserHostAddress()).HostName
Usually the call GetHostByAddress returns the correct hostname of the
client, but sometimes I get a hostname like _CERDR1342B88E.
Why? The clients are running under Windows CE.NET 4.1...
SvenSven wrote:

> Hi!
> I have a problem with
> System.Net.Dns.GetHostByAddress(ls_Request.UserHostAddress()).HostName
> Usually the call GetHostByAddress returns the correct hostname of the
> client, but sometimes I get a hostname like _CERDR1342B88E.
> Why? The clients are running under Windows CE.NET 4.1...
> Sven
What happens if you probe a ip address that returns such a name op port 445?
Is it open? If so, the computername is returned and not the hostname.
Someone with more knowledge of the tcp/ip system could clear this out.
//Rutger
You should post this to the
microsoft.public.dotnet.framework.compactframework group.
feroze
==============
this posting is provided as-is.
"Rutger Smit" <DoDotNet@.gmail.com> wrote in message
news:10jf0rcdh7os851@.corp.supernews.com...
> Sven wrote:
>
> What happens if you probe a ip address that returns such a name op port
445?
> Is it open? If so, the computername is returned and not the hostname.
> Someone with more knowledge of the tcp/ip system could clear this out.
> //Rutger
Well, the call System.Net.Dns.GetHostByAddress is executed on a
Windows 2003 Server... and i want to get the hostname of an IP address
(from a Windows CE system). I don't know if the behaviour is specific
to CE...
"Feroze [msft]" <ferozed@.online.microsoft.com> wrote in message news:<413795eb$1@.news.microsoft.c
om>...
> You should post this to the
> microsoft.public.dotnet.framework.compactframework group.
> feroze
> ==============
> this posting is provided as-is.
Rutger Smit <DoDotNet@.gmail.com> wrote in message news:<10jf0rcdh7os851@.corp.supernews.com>
..
> Sven wrote:
>
> What happens if you probe a ip address that returns such a name op port 44
5?
> Is it open? If so, the computername is returned and not the hostname.
> Someone with more knowledge of the tcp/ip system could clear this out.
> //Rutger
I looked up the computername on the windows ce machines, but the
computername is the one we set initialy (not _CERDR1342B88E)! But the
call System.Net.Dns.GetHostByAddress returns _CERDR1342B88E. I don't
know what the call System.Net.Dns.GetHostByAddress exactly does, but
it does not seem to be right.
Since the hostname is not really _CERDR1342B88E, i think a probe on
port 445 does not make sense...
Sven
Sven wrote:

> Rutger Smit <DoDotNet@.gmail.com> wrote in message news:<10jf0rcdh7os851@.co
rp.supernews.com>...
>
> I looked up the computername on the windows ce machines, but the
> computername is the one we set initialy (not _CERDR1342B88E)! But the
> call System.Net.Dns.GetHostByAddress returns _CERDR1342B88E. I don't
> know what the call System.Net.Dns.GetHostByAddress exactly does, but
> it does not seem to be right.
> Since the hostname is not really _CERDR1342B88E, i think a probe on
> port 445 does not make sense...
> Sven
It looks like GetHostByAddress does NOT always do a reverse lookup. Ik
don't know what is doe. Try to analyze the network logs that can be
caputred using Ethereal.
The port 445 suggestion was becaus of the computername, but it doens't
have anything to do with it.
//Rutger

Saturday, March 24, 2012

System.Net.WebClient and UploadFile() Problem

I am using WebClient to upload a file to a remote server. The call I'm
making looks as follows:
webClient.UploadFile("http://sdtpcal.someserver.com/Federation/Databases/Fed
eration.Zip",
@dotnet.itags.org."C:\Temp\Federation.Zip");
'Federation' is a virtual directory on the server I'm attempting to upload
the file to. The URL is valid and the file I'm attempting to transfer
exists. I keep getting 404 errors (not found). It's not clear to me exactly
what cannot be found. If I attempt to download this exact file from the same
exact URL using webClient.DownloadFile, it works fine!
Thanks for the help - Amos.You can not simply upload file on a server.
Something should wait for that file at the server end.
So url http://sdtpcal.someserver.com/Feder.../Federation.Zip to
download file looks correct.
but to upload you must write an ASPX page that will accept file and save to
the folder on a server.
George.
"Amos Soma" <amos_j_soma@.yahoo.com> wrote in message
news:OqGt9oK7GHA.1248@.TK2MSFTNGP03.phx.gbl...
>I am using WebClient to upload a file to a remote server. The call I'm
>making looks as follows:
> webClient.UploadFile("http://sdtpcal.someserver.com/Federation/Databases/F
ederation.Zip",
> @."C:\Temp\Federation.Zip");
> 'Federation' is a virtual directory on the server I'm attempting to upload
> the file to. The URL is valid and the file I'm attempting to transfer
> exists. I keep getting 404 errors (not found). It's not clear to me
> exactly what cannot be found. If I attempt to download this exact file
> from the same exact URL using webClient.DownloadFile, it works fine!
> Thanks for the help - Amos.
>
Thus wrote George Ter-Saakov,

> You can not simply upload file on a server.
> Something should wait for that file at the server end.
> So url
> http://sdtpcal.someserver.com/Feder.../Federation.Zip to
> download file looks correct.
> but to upload you must write an ASPX page that will accept file and
> save to the folder on a server.
You only need a web application endpoint for POST requests. If the OP can
use PUT, the web server may support this without any special user code (IIS
does for sure).
Both WebClient.UploadFile(uri, "PUT", fileName) and WebClient.OpenWrite(uri,
"PUT") will do the trick.
Cheers,
--
Joerg Jooss
news-reply@.joergjooss.de

System.Net.WebClient and UploadFile() Problem

I am using WebClient to upload a file to a remote server. The call I'm
making looks as follows:

webClient.UploadFile("http://sdtpcal.someserver.com/Federation/Databases/Federation.Zip",
@dotnet.itags.org."C:\Temp\Federation.Zip");

'Federation' is a virtual directory on the server I'm attempting to upload
the file to. The URL is valid and the file I'm attempting to transfer
exists. I keep getting 404 errors (not found). It's not clear to me exactly
what cannot be found. If I attempt to download this exact file from the same
exact URL using webClient.DownloadFile, it works fine!

Thanks for the help - Amos.You can not simply upload file on a server.
Something should wait for that file at the server end.

So url http://sdtpcal.someserver.com/Feder.../Federation.Zip to
download file looks correct.

but to upload you must write an ASPX page that will accept file and save to
the folder on a server.

George.

"Amos Soma" <amos_j_soma@.yahoo.comwrote in message
news:OqGt9oK7GHA.1248@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

>I am using WebClient to upload a file to a remote server. The call I'm
>making looks as follows:
>
webClient.UploadFile("http://sdtpcal.someserver.com/Federation/Databases/Federation.Zip",
@."C:\Temp\Federation.Zip");
>
'Federation' is a virtual directory on the server I'm attempting to upload
the file to. The URL is valid and the file I'm attempting to transfer
exists. I keep getting 404 errors (not found). It's not clear to me
exactly what cannot be found. If I attempt to download this exact file
from the same exact URL using webClient.DownloadFile, it works fine!
>
Thanks for the help - Amos.
>
>


Thus wrote George Ter-Saakov,

Quote:

Originally Posted by

You can not simply upload file on a server.
Something should wait for that file at the server end.
So url
http://sdtpcal.someserver.com/Feder.../Federation.Zip to
download file looks correct.
>
but to upload you must write an ASPX page that will accept file and
save to the folder on a server.


You only need a web application endpoint for POST requests. If the OP can
use PUT, the web server may support this without any special user code (IIS
does for sure).

Both WebClient.UploadFile(uri, "PUT", fileName) and WebClient.OpenWrite(uri,
"PUT") will do the trick.

Cheers,
--
Joerg Jooss
news-reply@.joergjooss.de

System.Nullreference Exception

i have written the following code to call a method in a class like

in the aspx.cs page
List<string> surls = new List<string>();

Cweb.GetMainUrls(document,ref surls);
Response.Write(surls);

in the Cweb Class page the coding is like

public static void GetMainUrls(Htmldocument doc,ref List<string> urls)
{
//Some functionalities
}

i get the following error when i run the application like

System.NullReference Exception
object reference not set to an instance

so because of this error my method is not getting called from the class and hence no result

can anyone help me out in finding like why my method was not called

i google through several sites and found that
this may be due to the fact that the "surls" are null and hence the method was not called
i dont follow these sequence

so anybody plz help me on this regard
thanks
Rama

System.NullReference Exception means you have referred an object, while this object is not instantialized.
object reference not set to an instance"this may be due to the fact that the "surls" are null and hence the method was not called " --> i think it's probablely because of that. So, set a break point there and debug. then see what the value of urls is. (well, response.write maybe a easier way to do that)

Hope my suggestion helps :)

Tuesday, March 13, 2012

System.Runtime.InteropServices.COMException

Hi,

I am using a VB6 dll in my asp.net application.

When I call a function of that dll, I get the following error:

System.Runtime.InteropServices.COMExceptionType mismatch.

The function I am calling expects a String, and I am passing in a String.

Here is the function call:

format.ProperCase(rs("Fname"))

Please help!

try

format.ProperCase(rs.Fields("Fname").Value.ToString() )


Thank you. Do I have to do this every time now? I am converting a classic ASP page to .NET and I make this function call a lot passing in recordset fields.