亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? windows internet programming part1.html

?? a collection of mega hacking tools
?? HTML
?? 第 1 頁 / 共 5 頁
字號:
   }



      	      	server.sin_family      	= AF_INET;         

      	      	server.sin_port      	= htons(PORT);          /* Remember htons() from "Conversions" section? =) */

      	      	server.sin_addr.s_addr      = INADDR_ANY;       /* INADDR_ANY puts your IP address automatically */



   if(bind(fd,(struct sockaddr*)&server,sizeof(struct sockaddr)) == -1) /* calls bind() */

   { 

         MessageBox(0,"Bind Error","Error",0);

            return -1;

   }    





   if(listen(fd,BACKLOG) == -1) /* calls listen() */

   { 

         MessageBox(0,"Listen Error","Error",0);

            return -1;

   }





      while(1)

      {

      sin_size = sizeof(struct sockaddr_in);

      if ((fd2 = accept(fd,(struct sockaddr *)&client,&sin_size)) == -1) /* calls accept() */

      

      {



         MessageBox(0,"Accept Error","Error",0);

         return -1;



      }

  

         MessageBox(0,"Client connected to server.","Connection",0);





         send(fd2,"Welcome to my server.\n",22,0); /* send to the client welcome message */



   WSACleanup();



   return -1;



}

}



      if (message == WM_DESTROY)

      	PostQuitMessage(0);



      return DefWindowProc(hwnd, message, wParam, lParam);

}





/* <---- SOURCE CODE ENDS HERE ----> */







This is the same code as the streaming server in bracamans tutorial, except this has been ported to windows,

the names bracaman uses in the program and the comments are the same.





4.2 BRACAMANS CLIENT EXAMPLE - WIN32

=======================================



And of course every server has to have a client...





/* <---- SOURCE CODE STARTS HERE ----> */





#include <windows.h>

#include <stdio.h>



#define PORT 3550      	      	/* Port that will be opened */ 

#define MAXDATASIZE 100      	      /* Max number of bytes of data */





struct       hostent *he;           /* structure that will get information about remote host */

struct       sockaddr_in server;    /* server's address information */



int      numbytes;      	      /* files descriptors */

char         buf[MAXDATASIZE];      /* buf will store received text */





WSADATA  wsdata;

SOCKET   sock;

DWORD    wsock;





LRESULT CALLBACK recall (HWND, UINT, WPARAM, LPARAM);



int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)



{

      static TCHAR szAppName[] = TEXT("Interface");



      HWND      	hwnd;

      MSG      	msg;

      WNDCLASS      wndclass;



      wndclass.style      	= CS_HREDRAW | CS_VREDRAW;

      wndclass.lpfnWndProc    = recall;

      wndclass.cbClsExtra     = 0;

      wndclass.cbWndExtra     = 0;

      wndclass.hInstance      = hInstance;

      wndclass.hIcon      	= LoadIcon (NULL, IDI_APPLICATION);

      wndclass.hCursor      	= LoadCursor (NULL, IDC_ARROW);

      wndclass.hbrBackground  = (HBRUSH) GetStockObject (WHITE_BRUSH);

      wndclass.lpszMenuName   = NULL;

      wndclass.lpszClassName  = "Interface";

      

      RegisterClass (&wndclass);



      hwnd = CreateWindow (szAppName,      	// Windows Class Name

      	      	 "Interface",      	// Windows Caption

      	      	 WS_OVERLAPPEDWINDOW,   // Windows Style

      	      	 CW_USEDEFAULT,      	// initial x position

      	      	 CW_USEDEFAULT,      	// initial y position

      	      	 200,      	      	// initial x size

      	      	 200,      	      	// initial y size

      	      	 0,      	      	// parent window handle

      	      	 0,      	      	// parent menu handle

      	      	 hInstance,      	      // program instance handle

      	      	 0);      	      	// creation parameters





      ShowWindow(hwnd, iCmdShow);



      while (GetMessage (&msg, NULL, 0, 0))

      {

      	DispatchMessage  (&msg);

      }

      return 1;

}





LRESULT CALLBACK recall (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)

{

if (message == WM_LBUTTONDOWN)

{   

   WSAStartup(0x0101,&wsdata); 

   



   he = gethostbyname("localhost");      	      	      	/* calls gethostbyname() */



   if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1)      	/* calls socket() */

   {

         MessageBox(0,"Socket Error","Error",0);

         return -1;

   }





      	server.sin_family = AF_INET;

      	server.sin_port = htons(PORT);      	                /* htons() is needed again */

      	server.sin_addr = *((struct in_addr *)he->h_addr);        /* he->h_addr passes "*he"'s info to "h_addr" */







   if(connect(sock,(struct sockaddr *)&server,sizeof(struct sockaddr)) == -1) /* calls connect() */

   {

          MessageBox(0,"Connection Error","Error",0);

         return -1;

   }  





   if ((numbytes = recv(sock,buf,MAXDATASIZE,0)) == -1)      	/* calls recv() */

   {

          MessageBox(0,"Receiving Error","Error",0);

         return -1;

   }





   buf[numbytes]='\0';



   MessageBox(0,buf,"Server Message",0); /* it prints server's welcome message =) */





   WSACleanup();



   return -1;



}





      if (message == WM_DESTROY)

      	PostQuitMessage(0);



      return DefWindowProc(hwnd, message, wParam, lParam);

}





/* <---- SOURCE CODE ENDS HERE ----> */







Again the code is almost the exact same as the original just ported and 1 or 2 different names for things.



We have covered all of this stuff already so theres nothing new here for you to learn except of course

for how to put it all together :).



As you can tell from the code, both the client and server are stream orientated, and what does this mean?

It means that they use TCP rather than UDP as the protocol.



________________________________________________________________________________________________________





5.0 EXPLORING THE WINSOCK

=======================================



Of course its the winsock that makes all this code work and ive already told you what functions like

htons() and inet_addr() do to numbers, but now its time to show you.





5.1 LOOKING AT INET_ADDR

=======================================





/* <---- SOURCE CODE STARTS HERE ----> */





#include <windows.h>

#include <stdio.h>



void outtie(char *p)

{

   FILE *fp=fopen("c:\\inet_addr.txt","a+");

   fprintf(fp,"%s\n",p);

   fclose(fp);

}



long      adrss;

char      output[200];



LRESULT CALLBACK recall (HWND, UINT, WPARAM, LPARAM);



int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)



{

      static TCHAR szAppName[] = TEXT("Interface");



      HWND      	hwnd;

      MSG      	msg;

      WNDCLASS      wndclass;



      wndclass.style      	= CS_HREDRAW | CS_VREDRAW;

      wndclass.lpfnWndProc    = recall;

      wndclass.cbClsExtra     = 0;

      wndclass.cbWndExtra     = 0;

      wndclass.hInstance      = hInstance;

      wndclass.hIcon      	= LoadIcon (NULL, IDI_APPLICATION);

      wndclass.hCursor      	= LoadCursor (NULL, IDC_ARROW);

      wndclass.hbrBackground  = (HBRUSH) GetStockObject (WHITE_BRUSH);

      wndclass.lpszMenuName   = NULL;

      wndclass.lpszClassName  = "Interface";

      

      RegisterClass (&wndclass);



      hwnd = CreateWindow (szAppName,      	// Windows Class Name

      	      	 "Interface",      	// Windows Caption

      	      	 WS_OVERLAPPEDWINDOW,   // Windows Style

      	      	 CW_USEDEFAULT,      	// initial x position

      	      	 CW_USEDEFAULT,      	// initial y position

      	      	 200,      	      	// initial x size

      	      	 200,      	      	// initial y size

      	      	 0,      	      	// parent window handle

      	      	 0,      	      	// parent menu handle

      	      	 hInstance,      	      // program instance handle

      	      	 0);      	      	// creation parameters





      ShowWindow(hwnd, iCmdShow);



      while (GetMessage (&msg, NULL, 0, 0))

      {

      	DispatchMessage  (&msg);

      }

      return 1;

}





LRESULT CALLBACK recall (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)

{

if (message == WM_LBUTTONDOWN)

{   

       adrss = inet_addr("127.0.0.1");



       sprintf(output,"Internet Address = %ld",adrss);

     outtie(output);

}





      if (message == WM_DESTROY)

      	PostQuitMessage(0);



      return DefWindowProc(hwnd, message, wParam, lParam);

}





/* <---- SOURCE CODE ENDS HERE ----> */





This program is simple, in the beginning we set up the function outtie,

this function takes the char, output, and prints it to a file called inet_addr.txt in the C:\ drive.



We go all inet_addr on the IP address 127.0.0.1's ass and put the result in output.

We then call outtie(); and the result of inet_addr is put into the text file.

Taadaaaa.



Run this program and click on the client area, wait a second then close it.

Goto your C:\ drive and open the file inet_addr.txt.

The file should look something like this



      [ inet_addr.txt ]



Internet Address = 537001100





and that is that.





5.2 LOOKING AT HTONS()

=======================================





/* <---- SOURCE CODE STARTS HERE ----> */





#include <windows.h>

#include <stdio.h>



     

long      port;

char      output[200];



LRESULT CALLBACK recall (HWND, UINT, WPARAM, LPARAM);



int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)



{

      static TCHAR szAppName[] = TEXT("Interface");



      HWND      	hwnd;

      MSG      	msg;

      WNDCLASS      wndclass;





      wndclass.style      	= CS_HREDRAW | CS_VREDRAW;

      wndclass.lpfnWndProc    = recall;

      wndclass.cbClsExtra     = 0;

      wndclass.cbWndExtra     = 0;

      wndclass.hInstance      = hInstance;

      wndclass.hIcon      	= LoadIcon (NULL, IDI_APPLICATION);

      wndclass.hCursor      	= LoadCursor (NULL, IDC_ARROW);

      wndclass.hbrBackground  = (HBRUSH) GetStockObject (WHITE_BRUSH);

      wndclass.lpszMenuName   = NULL;

      wndclass.lpszClassName  = "Interface";

      

      RegisterClass (&wndclass);



      hwnd = CreateWindow (szAppName,      	// Windows Class Name

      	      	 "Interface",      	// Windows Caption

      	      	 WS_OVERLAPPEDWINDOW,   // Windows Style

      	      	 CW_USEDEFAULT,      	// initial x position

      	      	 CW_USEDEFAULT,      	// initial y position

      	      	 200,      	      	// initial x size

      	      	 200,      	      	// initial y size

      	      	 0,      	      	// parent window handle

      	      	 0,      	      	// parent menu handle

      	      	 hInstance,      	      // program instance handle

      	      	 0);      	      	// creation parameters





      ShowWindow(hwnd, iCmdShow);



      while (GetMessage (&msg, NULL, 0, 0))

      {

      	DispatchMessage  (&msg);

      }

      return 1;

}





LRESULT CALLBACK recall (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)

{

if (message == WM_LBUTTONDOWN)

{   



      port = htons(80);





    sprintf(output,"Port 80 = %ld",port);

    MessageBox(0,output,"Port",0);

                     



}





      if (message == WM_DESTROY)

      	PostQuitMessage(0);



      return DefWindowProc(hwnd, message, wParam, lParam);

}





/* <---- SOURCE CODE ENDS HERE ----> */





This program is very similiar to the last one but this one looks at htons() rather than inet_addr.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品成人网| 久久精品人人爽人人爽| 五月天激情综合网| 欧美少妇性性性| 日本不卡免费在线视频| 欧美不卡一二三| 成人免费视频app| 一区二区三区在线看| 精品污污网站免费看| 免费在线观看一区二区三区| 精品美女一区二区| av电影一区二区| 一区二区三区国产| 欧美一级高清大全免费观看| 九色综合狠狠综合久久| 国产精品午夜春色av| 欧美亚洲综合一区| 欧美a一区二区| 中文字幕在线一区免费| 欧美日韩亚州综合| 国产成都精品91一区二区三| 亚洲黄色免费电影| 亚洲精品在线三区| 在线亚洲+欧美+日本专区| 男女性色大片免费观看一区二区 | 亚洲不卡在线观看| 日韩女优av电影| 91在线免费看| 精品综合久久久久久8888| 中文字幕中文字幕一区| 欧美一区二区在线观看| 成人性生交大片免费看中文| 亚洲国产精品天堂| 中文字幕av资源一区| 这里是久久伊人| 99视频有精品| 国产综合色精品一区二区三区| 亚洲欧洲av色图| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | www.日韩精品| 久久超碰97中文字幕| 亚洲黄色小视频| 国产午夜精品理论片a级大结局| 欧美性淫爽ww久久久久无| 成人在线视频一区| 精品亚洲porn| 丝袜诱惑亚洲看片| 中文字幕日韩欧美一区二区三区| 日韩免费观看高清完整版在线观看 | 亚洲同性同志一二三专区| 日韩精品一区二| 欧美日韩精品系列| 99久久99久久精品国产片果冻| 九色|91porny| 免费在线看成人av| 午夜精品福利一区二区蜜股av| 中文字幕一区二区三区在线不卡 | 一本色道久久综合亚洲精品按摩| 国产精品亚洲第一区在线暖暖韩国 | 欧美在线视频日韩| 琪琪久久久久日韩精品| 亚洲图片一区二区| 成人av资源网站| 蜜臂av日日欢夜夜爽一区| 午夜电影一区二区| 亚洲国产成人av好男人在线观看| 17c精品麻豆一区二区免费| 国产日韩影视精品| 国产欧美精品在线观看| 久久久久久亚洲综合| 精品国产污网站| 久久综合九色综合欧美98| 日韩精品影音先锋| 欧美成人在线直播| 日韩欧美123| 2021国产精品久久精品| 日韩视频一区二区在线观看| 欧美一级二级在线观看| 日韩你懂的在线播放| 欧美mv和日韩mv国产网站| 久久综合色综合88| 亚洲国产成人在线| 中文字幕一区二区三区精华液| 亚洲国产精品v| 亚洲美女在线国产| 亚洲电影一级黄| 麻豆国产一区二区| 国产精品影视在线观看| 亚洲美女在线国产| 一区二区成人在线观看| 亚洲乱码国产乱码精品精可以看| 亚洲精品高清在线| 午夜电影网亚洲视频| 精品一区二区三区av| 国产高清精品久久久久| av一二三不卡影片| 欧美怡红院视频| 日韩欧美一卡二卡| 久久这里只精品最新地址| 国产欧美精品一区aⅴ影院| 中文一区二区完整视频在线观看| 自拍偷拍国产精品| 日韩av不卡在线观看| 国产一区久久久| 972aa.com艺术欧美| 51精品秘密在线观看| 国产日本欧洲亚洲| 一区二区三区日韩| 日产欧产美韩系列久久99| 国产传媒久久文化传媒| 欧美三级中文字| 精品成a人在线观看| 亚洲欧美电影一区二区| 麻豆精品久久精品色综合| 91在线精品秘密一区二区| 99久久精品国产麻豆演员表| 综合网在线视频| 亚洲超丰满肉感bbw| 国产原创一区二区| 日本韩国精品在线| 欧美刺激脚交jootjob| 一区二区三区免费网站| 久久精品国产网站| 91久久人澡人人添人人爽欧美| 日韩视频在线一区二区| 亚洲免费观看在线观看| 蜜桃视频在线一区| www.一区二区| www欧美成人18+| 亚洲电影一级片| 91在线一区二区三区| 精品区一区二区| 亚洲国产精品久久不卡毛片| 高清shemale亚洲人妖| 欧美一区二区日韩| 一区二区日韩av| av网站一区二区三区| 久久精品免视看| 奇米一区二区三区| 欧美亚洲国产怡红院影院| 欧美激情综合网| 精品在线一区二区三区| 欧美日韩另类一区| 亚洲欧美精品午睡沙发| 福利一区在线观看| 久久综合久久久久88| 男人操女人的视频在线观看欧美| 欧美在线短视频| 亚洲美女偷拍久久| 99久久免费国产| 国产欧美精品一区二区色综合 | 99精品国产91久久久久久 | 久久久久久电影| 国产真实乱偷精品视频免| 91精品国产高清一区二区三区 | 亚洲日本韩国一区| www.亚洲国产| 国产精品久久久久久久久搜平片| 国产成人av福利| 久久综合精品国产一区二区三区 | 99久久精品国产麻豆演员表| 欧美激情综合网| 成人国产精品免费观看动漫 | 日韩欧美国产成人一区二区| 亚洲成人黄色小说| 在线不卡中文字幕播放| 日本欧美大码aⅴ在线播放| 欧美酷刑日本凌虐凌虐| 亚洲综合一区二区精品导航| 色噜噜狠狠成人中文综合| 亚洲精品国产精华液| 色综合久久天天| 午夜视频一区二区三区| 在线播放中文字幕一区| 久久精品国产一区二区| 久久久久青草大香线综合精品| 国产成人免费在线观看不卡| 欧美国产日韩a欧美在线观看| 国产91对白在线观看九色| 成人欧美一区二区三区视频网页| 日本韩国精品在线| 三级久久三级久久久| 日韩美女在线视频| 久久草av在线| 中文字幕免费不卡在线| 色老汉av一区二区三区| 日本午夜精品一区二区三区电影| 日韩欧美一区二区在线视频| 狠狠色丁香婷综合久久| 国产日韩欧美不卡| 91视视频在线观看入口直接观看www| 亚洲最新在线观看| 欧美一卡二卡三卡四卡| 国产成人亚洲综合a∨猫咪| 国产精品乱人伦中文| 欧美人动与zoxxxx乱| 九九久久精品视频| 亚洲欧美国产高清| 欧美电影精品一区二区| 大胆欧美人体老妇|