I've searched everywhere and tried it on two computers, and I'm completely stumped on this one.
I'm using VB Express Edition with .net 2.0 on Windows XP SP2 attempting to create a simple telnet client. According to the documentation and all the web searches I've found, the correct way to connect to a (named) internet server is to use system.net.ipaddress.parse("theaddress.com") which returns an ipaddress I can then combine with a port and use to open a socket connection to the server.
The problem is that I get an error saying that the .parse method is undefined, and so my code (which I believe is otherwise correct) doesn't compile. Is this a disabled feature in VB Express Or is it deprecated in the current version of .net If so, what is the replacement/workaround for this feature
Thanks in advance for your help.

system.net.ipaddress.parse
spirit7301
I've always found that the specifiying namespace.class usually does suffice.
BUT I've also learned that when there are things that you KNOW are there and are not defined then an import will help at times. I've found this is be especially true with intellisense.
When you have questions along these lines, I really recommend the unsung heroine of VS2005 which is the object browser. It's wonderful for chasing these things down and it's fast.
Renee
CoreComps
From time to time... with rare classes, I've noticed strangenesses that I really didn't understand.
When I see strangenesses especially where things are not defined, an Imports doesn't hurt and fixes the problem 80 percent of the time.
anandss
Public Class Form1
mycall
Imports
System.Net.IPAddress Class Form1 Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim a As System.Net.IPAddressa = System.Net.IPAddress.Parse(
"0.0.0.0")
End SubThis works for me
Sarah Brian
Works for me at work, where I have both Visual C++ Express and Visual Basic Express installed. But it doesn't work for me at home where I have only Visual Basic Express installed.
I'll try re-installing it at home, maybe it's as simple as a corrupted download.
In the meantime, the workaround Renee posted works both at home and at work, so I should be able to use that without any problems. Thanks for the help.
Bernie a
For the curious, I'm coming from a RealBasic, C++, and Cocoa background-- I've never used VB before.
olmich
There's a difference between importing a Namespace and a class. By using:
Imports
System.Net.IPAddressYou are importing a class and can call the parse method of that class because it is static (you don't need an instance of that class to call the parse method), as I understand it. Thus you can call:
addr = Parse("127.0.0.1")
But:
addr = System.Net.IPAddress.Parse("127.0.0.1")
Should work (and does) without the Imports declaration, so I'm not sure what's going on with your system, and was posting the above as possibly a helpful pointer.
Do you get the problem in a brand new project It's possible that the project you have may have some kind of namespace conflict
Andre Azevedo
This entire .net environment is designed, so there must be some design reason why you need to use "import" and when you don't. Is it possible that someone with more knowledge of that reason is reading this and could post It'll save me tons of time in the future if I know the rule, thanks. (No offense, Renee.)
Cytodex
Thanks for your help, it does work.