|
Convert doesn't know how to make an IP address into a string, but System.Net.IPAddress knows how to turn itself into a string.
textBox3.Text = Dns.GetHostAddresses("www.google.com").ToString;
Ain't Google/MSDN wonderful?
Peter
[edit] Didn't notice the plural addresses. You'll need to wrap a loop around it... [/edit]
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
The result i get in te textbox from that is
System.Net.IPAddress[]
someone suggested that I put in
Dns.GetHostEntry("google.com").HostName
the result from that was 'google.com' in the textbox
nothing is working... I tried a new console app project and i get same result
but when i do a powershell i get the result below, but not in my application. PLEASE HELP!
[System.Net.Dns]::GetHostAddresses("google.com")
Address : 2575508806
AddressFamily : InterNetwork
ScopeId :
IsIPv6Multicast : False
IsIPv6LinkLocal : False
IsIPv6SiteLocal : False
IPAddressToString : 70.37.131.153
modified 6-Jun-12 23:16pm.
|
|
|
|
|
After a bunch of tries i figured it out, it wouldn't let me convert IPAddress[] to IPAddress so then i figured its an array so let me just imply the index 0 to see whats in it. the code below works
IPAddress[] blah = Dns.GetHostAddresses("google.com");
System.Console.WriteLine(blah[0]);
|
|
|
|
|
Member 893460 wrote: it wouldn't let me convert IPAddress[] to IPAddress
Which is quite normal; how would you expect it to convert an array of objects into a single object?
|
|
|
|
|
When I said "wrap a loop around it" I meant something like
IPAddress[] adrslist = Dns.GetHostAddresses("www.google.com");
foreach System.Net.IPAddress ipadrs in adrslist {
.... = ipadrs.ToString;
}
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
thanks for that solution as well. I this would be great for something that requires you to obtain all the ip addresses, I just needed one for a textbox
|
|
|
|
|
mọi người giúp dùm mình vs 
|
|
|
|
|
Google translate thinks that is Vietnamese:
"need help moving vehicle code
help his people vs Corner"
I'm sure English is not your native language, but it is the default language for this site.
In English, your question makes no sense at all.
Please, either try to find a better translation of your question to English, or find a site in your own native language, as they may be able to help you better than we can!
Use the "Improve question" widget to edit your question and provide better information.
Tôi chắc chắn rằng tiếng Anh không phải ngôn ngữ mẹ đẻ của bạn, nhưng nó là ngôn ngữ mặc định cho trang web này.Trong tiếng Anh, câu hỏi của bạn làm cho không có ý nghĩa ở tất cả.Xin vui lòng, hoặc cố gắng để tìm một bản dịch tốt hơn của câu hỏi của bạn sang tiếng Anh, hoặc tìm một trang web bằng ngôn ngữ mẹ đẻ của bạn, vì họ có thể có thể giúp bạn tốt hơn so với chúng ta có thể!Sử dụng "Improve question" phụ tùng để sửa câu hỏi của bạn và cung cấp thông tin tốt hơn.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Sorry but posting this question in a language other than english has narrowed down those who can answer your question by a great deal.
|
|
|
|
|
|
Language, Timothy!
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Sorry - I meant to say "olifant"

|
|
|
|
|
Or "Fachyderm"!
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
I had to google that one...

|
|
|
|
|
Hi,
Does anyone know how can I handle any touches in windows, even when my application is minimized?
The idea was to maximize/minimize it when the user touches the screen with 3 or 4 fingers.
I was trying to find some kind of event from COM, but I don't know even if that's the way to go.
Any help is very appreciated!!
Thanks!
|
|
|
|
|
danielnbarros wrote: Does anyone know how can I handle any touches in windows, even when my application is minimized?
A minimized application does not have input-focus, and will receive a lot less notifications from Windows.
With a keyboard, I'd suggest a keyboard hook to catch your "hotkey". With "touch", it might be confusing if someone inserts a device that does not support multi-touch.
Bastard Programmer from Hell
|
|
|
|
|
How to make a screenshot of the screen and put it in and save a PictureBox1 SaveFileDialo
modified 6-Jun-12 8:18am.
|
|
|
|
|
This is an English speaking site.
Translated:
How to make a screenshot of the screen and place it to PictureBox1 and save through SaveFileDialo < g
...
Do so, but I save it in the folder of the Nada program, and through the SaveFileDialog # WindowsForm
|
|
|
|
|
ImageMemXfer ?
|
|
|
|
|
A single word with a question mark after it does not make a question.
We have no idea what you want.
|
|
|
|
|
Yes, then turn left twice and sacrifice a chicken.
Bastard Programmer from Hell
|
|
|
|
|
I have a component for playing, which, unfortunately, work in current thread. So, when i have an action in main thread, which duration more than player buffer, i have a delay in playing. I want to create this component in secondary thread. But if i call Start or Stop playing from main thread, it fall with exception or hang. So i need to call this component from this secondary thread(maybe with invoke or something else). How can i do this?
|
|
|
|
|
If the control is displaying something, then it should be created on the mainthread. Can you post some code? And what does "fall with exception or hang" mean? If the framework throws an Exception, it'll contain a message explaining what went wrong. It helps in diagnosing problems if you explained what type of exception you get, and what the message is.
Bastard Programmer from Hell
|
|
|
|
|
Is it a UI component? If so, you will have to leave it in the 'main' thread, and you should do your extended processing in a background thread (and, if you need to communicate with the component, you should use BeginInvoke or Invoke as you mention).
If not, you can put it in another thread, but you might have to write a wrapper to allow you to communicate with it across threads since Invoke is only provided on Control.
|
|
|
|
|
Sorry for long time silence. It isn't ui component. Just .net wrapper for playing sound files
PlayerEx playerEx = new PlayerEx();
playerEx.OpenPlayer(_format);
_playerEx.AddData(data);
_playerEx.StartPlay();
And in another moment i want to call
playerEx.Stop().
And usually function hungs on this moment
|
|
|
|