做爰高潮a片〈毛片〉,尤物av天堂一区二区在线观看,一本久久A久久精品VR综合,添女人荫蒂全部过程av

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當前位置: 首頁 - 科技 - 知識百科 - 正文

asp.net使用Socket.Send發送信息及Socket.SendFile傳輸文件的方法

來源:懂視網 責編:小采 時間:2020-11-27 22:36:53
文檔

asp.net使用Socket.Send發送信息及Socket.SendFile傳輸文件的方法

asp.net使用Socket.Send發送信息及Socket.SendFile傳輸文件的方法:本文實例講述了asp.net使用Socket.Send發送信息及Socket.SendFile傳輸文件的方法。分享給大家供大家參考,具體如下: // Displays sending with a connected socket // using the overload that takes a buffer. p
推薦度:
導讀asp.net使用Socket.Send發送信息及Socket.SendFile傳輸文件的方法:本文實例講述了asp.net使用Socket.Send發送信息及Socket.SendFile傳輸文件的方法。分享給大家供大家參考,具體如下: // Displays sending with a connected socket // using the overload that takes a buffer. p

本文實例講述了asp.net使用Socket.Send發送信息及Socket.SendFile傳輸文件的方法。分享給大家供大家參考,具體如下:

// Displays sending with a connected socket
// using the overload that takes a buffer.
public static int SendReceiveTest1(Socket server)
{
 byte[] msg = Encoding.UTF8.GetBytes("This is a test");
 byte[] bytes = new byte[256];
 try
 {
 // Blocks until send returns.
 int i = server.Send(msg);
 Console.WriteLine("Sent {0} bytes.", i);
 // Get reply from the server.
 i = server.Receive(bytes);
 Console.WriteLine(Encoding.UTF8.GetString(bytes));
 }
 catch (SocketException e)
 {
 Console.WriteLine("{0} Error code: {1}.", e.Message, e.ErrorCode);
 return (e.ErrorCode);
 }
 return 0;
}

// Establish the local endpoint for the socket.
IPHostEntry ipHost = Dns.GetHostEntry(Dns.GetHostName());
IPAddress ipAddr = ipHost.AddressList[0];
IPEndPoint ipEndPoint = new IPEndPoint(ipAddr, 11000);
// Create a TCP socket.
Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
// Connect the socket to the remote endpoint.
client.Connect(ipEndPoint);
// There is a text file test.txt located in the root directory.
string fileName = "C:\\test.txt";
// Send file fileName to remote device
Console.WriteLine("Sending {0} to the host.", fileName);
client.SendFile(fileName);
// Release the socket.
client.Shutdown(SocketShutdown.Both);
client.Close();

更多關于asp.net相關內容感興趣的讀者可查看本站專題:《asp.net操作json技巧總結》、《asp.net字符串操作技巧匯總》、《asp.net操作XML技巧總結》、《asp.net文件操作技巧匯總》、《asp.net ajax技巧總結專題》及《asp.net緩存操作技巧總結》。

希望本文所述對大家asp.net程序設計有所幫助。

聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

asp.net使用Socket.Send發送信息及Socket.SendFile傳輸文件的方法

asp.net使用Socket.Send發送信息及Socket.SendFile傳輸文件的方法:本文實例講述了asp.net使用Socket.Send發送信息及Socket.SendFile傳輸文件的方法。分享給大家供大家參考,具體如下: // Displays sending with a connected socket // using the overload that takes a buffer. p
推薦度:
標簽: 方法 File send
  • 熱門焦點

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 城固县| 纳雍县| 囊谦县| 渭南市| 西贡区| 尚志市| 岫岩| 扬州市| 临西县| 湘潭市| 青铜峡市| 离岛区| 临洮县| 乾安县| 抚顺县| 郸城县| 石渠县| 六枝特区| 且末县| 西盟| 高台县| 洪洞县| 阳高县| 富川| 库尔勒市| 灵石县| 万州区| 东乡| 金塔县| 隆德县| 甘南县| 珲春市| 海城市| 吴堡县| 巴中市| 鄄城县| 原平市| 甘谷县| 崇仁县| 长治县| 汨罗市|