WxWidgets obtains the IP address and computer name of the local machine.

Source: Internet
Author: User
Tags wxwidgets

It was really a good time to do things at night. The last time I got an IP address for half a day, I did not succeed. I sorted out my ideas this time, I carefully read the wxWidgets document. The English waste continues to be nipped in the E document ....) one-time success. The premise for obtaining the IP address of the Local Computer today is to get the name of the local computer. 650) this. width = 650; "onclick = 'window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'alt = "" src = "http://www.bkjia.com/uploads/allimg/131228/1ZU5IS-0.jpg" border = "0"/> directly paste the main code snippet, do memo 650) this. width = 650; "onclick = 'window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/> void ttFrame: showtxt (wxMouseEvent & event)
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/> {
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/>
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/> // create wx4244address object
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/> wx4244address addr;
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/> // get the local computer name
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/> wxString computerName =: wxGetFullHostName ();
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/> // get the current user name
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/> wxString username =: wxGetUserId ();
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/> // assign a value to the hostname attribute of wx00004address (" computer name ")
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src)" src = "http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif" align = "top"/> addr. Hostname (computerName );
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/> // get the IP address
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/> wxString ipaddr = addr. IPAddress ();
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/>
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/> // output data to the text box
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/> txt_ip-> AppendText (ipaddr );
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/>
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/> txt_cmpname-> AppendText (computerName );
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/>
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/> txt_username-> AppendText (username );
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/>
650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'src =" http://www.bkjia.com/uploads/allimg/131228/1ZU5I26-1.gif "align =" top "/>}

This article is from the "Jiu Li tribe" blog, please be sure to keep this source http://axiii.blog.51cto.com/396236/107886

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.