全て
| カテゴリ未分類
| 通常
| 数学
| 投資
| 副業
| 転職・就職
| ブログ
| 株Stock
| VBA
| SharePoint
| REST API
| RenderListDataAsStream
| PowerAutomateDesktop
| Graph API
| PowerApps
| PowerAutomate
| PowerFx
| OfficeScriptオフィススクリプト
| PowerAutomate日時Excel日時相互関係
| PowerShell
| Dataverse
| UiPath
| OneDrive
| LINQ
| VB.NET
| C#.NET
| WPFC#.NET
| Git
カテゴリ:VB.NET
using System; using System.Net; using System.Net.Sockets; using System.Text; class Program { static void Main(string[] args) { // 25番ポートを監視する int port = 25; TcpListener listener = new TcpListener(IPAddress.Any, port); listener.Start(); Console.WriteLine("Waiting for connections..."); while (true) { // クライアントからの接続を待機 TcpClient client = listener.AcceptTcpClient(); Console.WriteLine("Connected to client."); // ネットワークストリームを取得してデータを読み取る NetworkStream stream = client.GetStream(); byte[] buffer = new byte[client.ReceiveBufferSize]; int bytesRead = stream.Read(buffer, 0, buffer.Length); // データを文字列に変換して表示 string dataReceived = Encoding.ASCII.GetString(buffer, 0, bytesRead); Console.WriteLine("Data received: " + dataReceived); // 接続を閉じる client.Close(); } } } お気に入りの記事を「いいね!」で応援しよう
Last updated
2024.02.25 09:26:17
[VB.NET] カテゴリの最新記事
|