»ñÈ¡IPµÄC ´úÂë
»ñÈ¡IPµÄC ´úÂë #include<stdio.h> #include<winsock2.h> #pragma comment(lib,"ws2_32.lib") void CheckIP(void) //¶¨ÒåCheckIP£¨£©º¯Êý£¬ÓÃÓÚ»ñÈ¡±¾»úIPµØÖ· { WSADATA wsaData; char name[255]; //¶¨ÒåÓà ...
»ñÈ¡IPµÄC ´úÂë
#include<stdio.h>
#include<winsock2.h>
#pragma comment(lib,"ws2_32.lib")
void CheckIP(void) //¶¨ÒåCheckIP£¨£©º¯Êý£¬ÓÃÓÚ»ñÈ¡±¾»úIPµØÖ·
{
WSADATA wsaData;
char name[255]; //¶¨ÒåÓÃÓÚ´æ·Å»ñµÃµÄÖ÷»úÃûµÄ±äÁ¿
char *ip; //¶¨ÒåIPµØÖ·±äÁ¿
PHOSTENT hostinfo;
//µ÷ÓÃMAKEWORD£¨£©»ñµÃWinsock°æ±¾µÄÕýÈ·Öµ£¬ÓÃÓÚ¼ÓÔØWinsock¿â
if ( WSAStartup( MAKEWORD(2,0), &wsaData ) == 0 ) {
//ÏÖÔÚÊǼÓÔØWinsock¿â£¬Èç¹ûWSAStartup£¨£©º¯Êý·µ»ØֵΪ0£¬ËµÃ÷¼ÓÔسɹ¦£¬³ÌÐò¿ÉÒÔ¼ÌÐø
if( gethostname ( name, sizeof(name)) == 0) {
//Èç¹û³É¹¦µØ½«±¾µØÖ÷»úÃû´æ·ÅÈëÓÉname²ÎÊýÖ¸¶¨µÄ»º³åÇøÖÐ
if((hostinfo = gethostbyname(name)) != NULL) {
//ÕâÊÇ»ñÈ¡Ö÷»úÃû£¬Èç¹û»ñµÃÖ÷»úÃû³É¹¦µÄ»°£¬½«·µ»ØÒ»¸öÖ¸Õ룬ָÏòhostinfo£¬hostinfo
//ΪPHOSTENTÐ͵ıäÁ¿£¬ÏÂÃæ¼´½«Óõ½Õâ¸ö½á¹¹Ìå
ip = inet_ntoa (*(struct in_addr *)*hostinfo->h_addr_list);
//µ÷ÓÃinet_ntoa£¨£©º¯Êý£¬½«hostinfo½á¹¹±äÁ¿ÖеÄh_addr_listת»¯Îª±ê×¼µÄµã·Ö±íʾµÄIP
//µØÖ·£¨Èç192.168.0.1£©
printf("%s\n",ip);//Êä³öIPµØÖ·
}
}
WSACleanup( ); //жÔØWinsock¿â£¬²¢ÊÍ·ÅËùÓÐ×ÊÔ´
} }
int main(void)
{
CheckIP();
return 0;
}
±¾ÆªÎÄÕÂÀ´Ô´ÓÚ ºÚ¿Í»ùµØ-È«Çò×î´óµÄÖÐÎĺڿÍÕ¾ ÔÎÄÁ´½Ó£ºhttp://www.hackbase.com/tech/2009-09-26/56463.html
Ïà¹ØÎĵµ£º
CÓïÑÔÖÐûÓк¯ÊýÖØÔصĸÅÄ£¡
CÓïÑÔÖÐûÓк¯ÊýÖØÔصĸÅÄ£¡
½ñÌìMSNȺÖÐÓиöÈËÎÊÎÒCÓïÑÔµÄÎÊÌ⣺
£¨Á½¸öº¯ÊýʵÏֵŦÄÜÏàͬ
µ«ÊÇËüÃDzÎÊýµÄ¸öÊý²»Í¬
ÎÒÓÃÒ»¸öº¯Êý°ÑÕâ¸öÁ½¸öº¯Êý·âÆðÀ´
&n ......
The C# classes that you design will be used by code that you write and possibly by code that
other people write. Your C# classes may be used by a VB.NET application or from within an
ASP.NET page. Moreover, your classes may very well be used alongside other classes
designed by other .NET develope ......
ËÄÜ°ïÎÒ°ÑÕâ¶Î´úÂëת³ÉVbµÄ´úÂ룬²»Ê¤¸Ð¼¤£¬Ð»Ð»£¡
void CTempDlg::OnOK()
{
UpdateData(1);
int nlen=m_edit1.GetLength();
char *username=m_edit1.GetBuffer(nlen);//¶¨ÒåÒ»¸öÐÂ×Ö·û´®username,³¤¶ÈΪnlen£¬²¢½«m_edit1ÖеÄ×Ö·û´®Ò»¸ö¸ö·ÅÈëµ½usernameÊý×éÖÐ
char strA[]="90123456 ......
ÏÈѧVB£¬ÔÙѧC#¡£Ñ§ºÃÁËC#ѧC++¾Í²»ÔÚ»°ÏÂÁË£¡
»¹ÊÇÏÈÔÚCSÖн¨Á¢Ò»¸ö¿ØÖÆ̨³ÌÐò£¬ÔÙ´ò¿ª“Program.cs”¡£
ÔÚ void_Main ÊäÈëÒÔÏ´úÂ룺
Õâ´Î´úÂë½Ï³¤£¬ÎҾͲ»¸ßÁÁÁË£¡
double pp1;//¶¨Òå±äÁ¿
&nb ......
¶ÔÓÚxenµÄÐéÄ⻯¹ÜÀí£¬´ó¼Ò¶¼ÔÚÓÃʲôÄØ£¿ÎÒÕæµÄÏëÖªµÀÊDz»ÊÇ´ó¼Ò¶¼ÓÃxmÀ´½øÐйÜÀíÄØ£¿ÖÁÉÙÎÒÏë´ó¶àÊý½ö½öÏëÁ˽âһϵÄÅóÓÑ¿ÉÄÜÓÃÏÂxmÒ²¾ÍËãÊÇÁ˽âÁË¡£¶øÇÒÔÚxenµÄÓû§ÊÖ²áÀïÃæÒ²½ö½ö½éÉÜÁËÒ»ÏÂxmµÄʹÓ÷½·¨£¬¹ØÓÚÔõôʹÓÃËüµÄc½Ó¿ÚÀ´¹ÜÀíÐéÄ⻯·½ÃæµÄ½éÉÜÖ»×ÖδÌá¡£
ÎÒ²»½ö½öÏëÓÃxmÕâ¸ö¹¤¾ßÀ´´ ......