TCPãããã¯ã¼ã¯ãè¡ãã«ã¯ TcpClient ã¨ããã¯ã©ã¹ã¨ NetworkStream ã¨ããã¯ã©ã¹ãä¸æããã¨ä½¿ãã°è¯ããããã
ãã¼ã ã¹ãã¼ã¹ã¯ããã
System.Net.Sockets;
ã§ãåºæ¬çã«ã¯TcpClientã¯ã©ã¹ã使ã£ã¦ã³ãã¯ã·ã§ã³ãå¼µã£ã¦ãNetworkStreamã¯ã©ã¹ã§éåä¿¡ãè¡ãã¿ããã
Byte[] buff = new Byte[1024]; TcpClient tcpClient = new TcpClient(); tcpClient.Connect("xxx.xxx.xxx.xxx", 80); NetworkStream nwStream = tcpClient.GetStream(); // ãããã¯ã¼ã¯éä¿¡ç¨æååã®çæï¼ãã¤ãåã«å¤æï¼ buff = Encoding.ASCII.GetBytes("GET /index.html\r\n\r\n"); // ãããã¯ã¼ã¯ã¸éä¿¡ nwStream.Write(buff, 0, buff.Length); nwStream.Flush();
ã§ããåããã§ããã
æ¬å½ã¯å®éã«åããã¦ã¿ãããã ãã©ãã¡ãã£ã¨ãããã¯ã¼ã¯éä¿¡ã¨ã¯å¥ã®ä¸å
·åããã£ã¦ãã¡ãã¨åãã®ã確èªã§ããªãã®ã§ãã£ãã
ãããã¯ã¼ã¯ãããã¼ã¿ãåä¿¡ããæã«ããã®ãã¼ã¿ãã¹ã¬ããã§åããã¦åãåãããã«ãã¦ããã ãã©ããã®ã¹ã¬ããã§åãåã£ããã¼ã¿ãç´æ¥Formã®ããã¹ãã¨ãªã¢ã¸åããã¨ããã¨ãããªã¨ã©ã¼ãã§ã¦ãã¾ãã®ã ã
- -
System.InvalidOperationException: æå¹ã§ã¯ãªãã¹ã¬ããéã®æä½: ã³ã³ããã¼ã«ãä½æãããã¹ã¬ãã以å¤ã®ã¹ã¬ããããã³ã³ããã¼ã« 'resultBox' ãã¢ã¯ã»ã¹ããã¾ããã
- -
å½ç¶ãå¥ã¹ã¬ããã§åããã¦ããã®ã§ãã©ã¼ã ãçæããã¹ã¬ããã¨ã¯éãã®ã¯ããããã ãâ¦â¦ãããããããã
ã¦ãããããã¡ãã£ã¨ã¹ã¬ããã«ã¤ãã¦åå¼·ããå¿
è¦ããããªãã
FTPã¯ã©ã¤ã¢ã³ãã¨ãï¼ãï¼æ¥ã§ã§ããã¨æã£ã¦ããã ãã©ãããããã®åæç¥èã足ãç¡ãããããã ãè¦ç©ãã失æï¼