sdl顯示一張bmp圖片示例。本站提示廣大學習愛好者:(sdl顯示一張bmp圖片示例)文章只能為提供參考,不一定能成為您想要的結果。以下是sdl顯示一張bmp圖片示例正文
本文實例講述了C#檢測長途盤算機端口能否翻開的辦法。分享給年夜家供年夜家參考。詳細剖析以下:
這段C#代碼用於檢測長途盤算機的3389端口能否處置翻開狀況,可以依據現實須要設置其它端口
using System; using System.Collections.Generic; using System.Text; using System.Net.NetworkInformation; namespace test { class Program { static void Main(string[] args) { GetTcpConnections(); } public static void GetTcpConnections() { IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties(); TcpConnectionInformation[] connections = properties.GetActiveTcpConnections(); foreach (TcpConnectionInformation t in connections) { Console.Write("Local endpoint: {0} ", t.LocalEndPoint.ToString()); Console.Write("Remote endpoint: {0} ", t.RemoteEndPoint.ToString()); Console.WriteLine("{0}", t.State); } Console.WriteLine(); Console.ReadLine(); } } }
運轉成果以下:
Local endpoint: 127.0.0.1:1025 Remote endpoint: 127.0.0.1:1026 Established Local endpoint: 127.0.0.1:1026 Remote endpoint: 127.0.0.1:1025 Established Local endpoint: 127.0.0.1:1028 Remote endpoint: 127.0.0.1:16992 CloseWait Local endpoint: 127.0.0.1:1110 Remote endpoint: 127.0.0.1:4900 Established Local endpoint: 127.0.0.1:2754 Remote endpoint: 127.0.0.1:1110 CloseWait Local endpoint: 127.0.0.1:2762 Remote endpoint: 127.0.0.1:1110 CloseWait Local endpoint: 127.0.0.1:2773 Remote endpoint: 127.0.0.1:1110 CloseWait Local endpoint: 127.0.0.1:2913 Remote endpoint: 127.0.0.1:1110 CloseWait Local endpoint: 127.0.0.1:3014 Remote endpoint: 127.0.0.1:1110 CloseWait Local endpoint: 127.0.0.1:3531 Remote endpoint: 127.0.0.1:1110 CloseWait Local endpoint: 127.0.0.1:4012 Remote endpoint: 127.0.0.1:1110 CloseWait Local endpoint: 127.0.0.1:4900 Remote endpoint: 127.0.0.1:1110 Established
願望本文所述對年夜家的C#法式設計有所贊助。