Can I get the "Host Name" of the desktop computer my Pocket PC is connected with?

  • Thread starter Thread starter mhawbs
  • Start date Start date
M

mhawbs

Using Dns.GetHostName on the desktop returns "MyDesktopComputer" and
using Dns.GetHostName on the PocketPC returns "MyPocketPC". I want to
retrieve the host name of desktop (i.e. "MyDesktopComputer") from the
PocketPC. Is this possible?

Thanks!

Mike
 
What do you need it to return? "MyDesktopComputer"? I'm not sure that
you'll be able to get that, but you could try the following:

Since "ppp_peer" is resolved to the IP address of the connected host
computer (connected with ActiveSync), use that to get the IP address.
GetHostByName().

Now you have an IP address and want to try to get the name indicated. Try
passing that to GetHostByAddress().

As I said, I'm not too confident that this will work as there's not really a
machine who should be able to resolve that IP address to that host name.

Why do you want to do this? Maybe we can find a more-reliable way of
accomplishing what you want to do.

Paul T.
 
Thanks Paul. I'm using something called the "Microsoft SQL Server
2005 Everywhere Edition Access Database Synchronizer". Which, as the
name suggests, syncs an SQLCE database on the device with a MS Access
database. The sync is done from the PPC. To get the sync to work
some basic information is needed including the "Host Name" and "User
Name" of the desktop computer. Now, I could have the user do an
initial configuration where they manually enter this information, but
I thought it would be much easier to just have my app retrieve the
information automatically since I know the database will be on
whatever "host computer" they are syncing with.

So, yes, I would like it to return "MyDesktopComputer" as that is the
string that is needed....if possible. I can always have them manually
configure the settings too, which is looking like the more likely
scenario. Just thought maybe there was an easy way.

Mike
 
Back
Top