473,779 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB 2003 -> VB 2005 conversion questions

Hi!

Earlier using VB 2003 I used...

Net.Dns.Resolve (Net.Dns.GetHos tName()).Addres sList(0).ToStri ng()

....to retrieve IP-address of the local (first) NIC.

Now I'm starting to use VB 2005, and don't know how to do this same (get
IP-address) using new way of VB 2005?
Other question is how to determine windows version by using VB 2005? I
mean something like...

http://support.microsoft.com/default...22120121120120

....was for the older VB.

--
Thanks in advance!

Mika
Dec 28 '05 #1
4 2678
On Wed, 28 Dec 2005 12:15:05 +0200, Mika M
<ma************ ***@luukku.com> wrote:
Hi!

Earlier using VB 2003 I used...

Net.Dns.Resolv e(Net.Dns.GetHo stName()).Addre ssList(0).ToStr ing()

...to retrieve IP-address of the local (first) NIC.

Now I'm starting to use VB 2005, and don't know how to do this same (get
IP-address) using new way of VB 2005?
It's pretty much the same:
Debug.WriteLine (System.Net.Dns .GetHostEntry(M y.Computer.Name ).AddressList(0 ))

Just an example. Don't think you should hardcode the (0) at the end.

Not sure there is a shorter way of writing it.
Other question is how to determine windows version by using VB 2005? I
mean something like...

http://support.microsoft.com/default...22120121120120

...was for the older VB.


Debug.WriteLine (My.Computer.In fo.OSFullName & ": " &
My.Computer.Inf o.OSPlatform & ": " & My.Computer.Inf o.OSVersion)

(on my machine, result is "Microsoft Windows XP Professional: Win32NT:
5.1.2600.131072 ")

/JB


Dec 28 '05 #2
Hi,

DNS.Resolve is obsolete use dns.GetHostEntr y instead. You can use
environment.mac hinename instead of dns.gethostname if you would like.

Dim MyIp As Net.IPAddress
MyIp = Net.Dns.GetHost Entry(Net.Dns.G etHostName()).A ddressList(0)
Me.Text = MyIp.ToString
Ken
-------------------
"Mika M" <ma************ ***@luukku.com> wrote in message
news:eB******** *****@tk2msftng p13.phx.gbl...
Hi!

Earlier using VB 2003 I used...

Net.Dns.Resolve (Net.Dns.GetHos tName()).Addres sList(0).ToStri ng()

...to retrieve IP-address of the local (first) NIC.

Now I'm starting to use VB 2005, and don't know how to do this same (get
IP-address) using new way of VB 2005?
Other question is how to determine windows version by using VB 2005? I
mean something like...

http://support.microsoft.com/default...22120121120120

...was for the older VB.

--
Thanks in advance!

Mika

Dec 28 '05 #3
Thanks for your both - Jörgen and Ken - I got it!

Still one more question :) Is there new way for
System.Environm ent.UserName too? I mean something like My.something...

Anyway System.Environm ent.UserName is working fine - I'm just curious.

--
Mika
Dec 28 '05 #4
On Wed, 28 Dec 2005 14:32:16 +0200, Mika M
<ma************ ***@luukku.com> wrote:
Thanks for your both - Jörgen and Ken - I got it!

Still one more question :) Is there new way for
System.Environ ment.UserName too? I mean something like My.something...

Anyway System.Environm ent.UserName is working fine - I'm just curious.


These two lines should produce the same result:

Debug.WriteLine ("My User name: " & My.User.Name)

Debug.WriteLine ("SysEnv User Name: " &
System.Environm ent.UserDomainN ame & "\" & System.Environm ent.UserName)

/JB

Dec 28 '05 #5

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

Similar topics

1
4860
by: David Lee | last post by:
Need some help bad here. Am using VB.Net Standard 2003 supplied for a class and I need to install Msde and the sample databases to work on homework. Following the documentation I can download sql2kdesksp3.exe and get the server running. I cannot then install the sample databases according to directions. Log file follows: 2:28:26 AM Wednesday, October 01, 2003: 12:28:26 AM Wednesday, October 01, 2003: Modified the sourceview node of...
11
3765
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows 2003 Server or ADO or ODBC issue, I am posting this on all of the three newsgroups. That's the setup: Windows 2003 Server with IIS and ASP.NET actiavted Access 2002 mdb file (and yes, proper rights are set on TMP paths and path,
6
2146
by: David Waz... | last post by:
Moved an app from W/2000 Asp V1.0 to W/2003, VS/2003, ASPV 1.1 Page runs a long job, uploading 2 large fixed length files (300,000 rows) into SQL database. A process is run against the data, and altered flat-files produced. The job aborts at EXACTLY 105 seconds (1 min, 45 seconds) regardless of WHERE in the process we are - could be DB read, DB write, string manipulation - whatever.
22
3305
by: EP | last post by:
When running my asp.net hosting service (asp.net without IIS), on server 2003 with IIS not installed, I get the following when trying to process a request. "System.DllNotFoundException: Unable to load DLL (aspnet_isapi.dll)." Of course the dll is able to be found, it's still in the framework directory and for grins I even put it in my service's local directory. This is apparantly server 2003 not allowing asp.net to be run if IIS was not...
0
9474
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10306
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6727
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5504
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.