473,471 Members | 1,964 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Converting IP Address as string to MyIP as IPAddress


How do I convert "192.168.0.200" (as type string) to MyIP (as type
IPAddress)?

-Jerry

May 26 '06 #1
4 11471

"Jerry Spence1" <je**********@somewhere.com> wrote in message
news:44*********************@ptn-nntp-reader01.plus.net...

How do I convert "192.168.0.200" (as type string) to MyIP (as type
IPAddress)?


Example (uses a textbox to enter the address, but you get the idea...

IPAddress OutAddr;
if (IPAddress.TryParse(textBox1.Text, out OutAddr) == false)
{
MessageBox.Show("Address is not valid!", "Error");
return;
}
else
{
MessageBox.Show(OutAddr.ToString());
}
May 26 '06 #2

"james" <ja***@com.com> wrote in message
news:44***********************@news.zen.co.uk...

"Jerry Spence1" <je**********@somewhere.com> wrote in message
news:44*********************@ptn-nntp-reader01.plus.net...

How do I convert "192.168.0.200" (as type string) to MyIP (as type
IPAddress)?

Example (uses a textbox to enter the address, but you get the idea...

IPAddress OutAddr;
if (IPAddress.TryParse(textBox1.Text, out OutAddr) == false)
{
MessageBox.Show("Address is not valid!", "Error");
return;
}
else
{
MessageBox.Show(OutAddr.ToString());
}


Forgive me - thought I was in the C# group - but the same process should
apply (give or take)

May 26 '06 #3
Jerry,
Try
ipAddr = IPAddress.Parse("192.168.0.200")

Hope it solves..

May 26 '06 #4

"IdleBrain" <in**************@yahoo.com> wrote in message
news:11*********************@j55g2000cwa.googlegro ups.com...
Jerry,
Try
ipAddr = IPAddress.Parse("192.168.0.200")

Hope it solves..


Ah! Thanks very much indeed.
-Jerry
May 27 '06 #5

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

Similar topics

0
by: dermoon | last post by:
Hi! I want to fetch the address-string from the web-browser visiting a page on my apache-server (not using access-log). ex. "http://some-server/mydocument.html" To fetch the document name I...
4
by: blrmaani | last post by:
Here is what I want: string s1 = "This is a list of string"; list<string> s2 = s1.some_method(); Now, I should be able to traverse list s2 and get each member ( which is of type 'string' ). ...
5
by: sridev | last post by:
hi all, i have a xml file.I have converted the xml file to String using OuterXml....... now i am getting like this "<ClientList><Client...
1
by: Kevin S Gallagher | last post by:
I found this code (pretty sure it was from a MVP) for converting a string variable to a form object which works fine within a form. Take the code and place it into a code module and it fails on the...
0
by: rrp83 | last post by:
Hi All Can anyone fwd me the code for converting a string to bytes similar to the GetBytes function in C# and viceversa?? Regards, RRP83
2
by: CoreyWhite | last post by:
Problem: You have numbers in string format, but you need to convert them to a numeric type, such as an int or float. Solution: You can do this with the standard library functions. The...
10
by: Hank Stalica | last post by:
I'm having this weird problem where my code does the following conversion from string to float: 27000000.0 -27000000.00 2973999.99 -29740000.00 2989999.13 -2989999.25 The number on the left...
3
by: Jef Driesen | last post by:
How can I convert a date string to a number (e.g. a time_t value or a tm struct)? I know about the strptime function, but then I have to know the format string. And that is a problem. I'm trying...
17
by: romcab | last post by:
Hi guys, just want to ask how can I convert an IP address that is declared as String to type IPAddress? The reason why I come up with String IP address is because it came from a file. the...
0
by: ling2000 | last post by:
Hello all, I'm trying to upgrade a VB6 project into VB.net, and the problem I had is in converting 'address of' to 'delegate'. I had the error "Value of type 'DelegateIDccManSink_OnLogIpAddr'...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
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.