• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            posts - 124,  comments - 29,  trackbacks - 0

            using System;
            using System.Collections.Generic;
            using System.ComponentModel;
            using System.Data;
            using System.Drawing;
            using System.Text;
            using System.Windows.Forms;
            using System.Net;
            using System.Net.NetworkInformation;

            namespace PingIpAddress
            {
                public partial class Form1 : Form
                {
                    public Form1()
                    {
                        InitializeComponent();
                    }
                  
                    private void Form1_Load(object sender, EventArgs e)
                    {
                       
                       
                    }
                    private Ping pingSender = new Ping();
                    private string strIP = "";
                    private void button1_Click(object sender, EventArgs e)
                    {
                        strIP = txtIP.Text;
                        PingOptions pingOption = new PingOptions();
                        pingOption.DontFragment = true;

                        string data = "sendData:goodgoodgoodgoodgoodgood";
                        byte[] buffer = Encoding.ASCII.GetBytes(data);
                        int timeout = 120;
                        PingReply reply = pingSender.Send(strIP, timeout, buffer);
                        if (reply.Status == IPStatus.Success)
                        {
                            MessageBox.Show("能ping通 ");
                        }
                        else
                        {
                            MessageBox.Show("ping不通");
                        }
                    }
                }
            }

            using System;
            using System.Collections.Generic;
            using System.Windows.Forms;
            using System.Net;
            using System.Net.Sockets;
            using System.Threading;
            using System.Text;
            using OSSDOM.CMT.ConfigData;
            using System.Net;
            using System.Net.NetworkInformation;

            namespace OSSDOM.CMT.CommonUse
            {
                
            public class PingServer
                
            {
                    
                    
            private IPEndPoint EPServer = null;
                    
            public PingServer()
                    
            {
                        
            try
                        
            {
                            EPServer 
            = new IPEndPoint(IPAddress.Parse(MakeOptionDatas.MakeOptionDataInstance.proxy.strProxyIP), int.Parse(MakeOptionDatas.MakeOptionDataInstance.proxy.strProxyPort));
                        }

                        
            catch (Exception ex)
                        
            {
                            MessageBox.Show(ex.Message 
            + " " + ex.StackTrace);
                        }

                    }

                    
            //連接
                    private Ping pingSender = new Ping(); 
                    
            public bool ServerConnected()
                    
            {
                        
            try
                        
            {
                            PingOptions pingOption 
            = new PingOptions();
                            pingOption.DontFragment 
            = true;

                            
            string data = "sendData";
                            
            byte[] buffer = Encoding.ASCII.GetBytes(data);
                            
            int timeout = 120;
                            PingReply reply 
            = pingSender.Send(EPServer.Address, timeout, buffer);
                            
            if (reply.Status == IPStatus.Success)
                            
            {
                                
            //MessageBox.Show("能ping通 ");
                                return true;
                            }

                            
            else
                            
            {
                                
            //MessageBox.Show("ping不通");
                                return false;
                            }

                            
                            
                        }

                        
            catch
                        
            {
                            
            return false;
                        }

                    }

                    
            //斷開
                    public void Disconnect()
                    
            {
                        
                    }

                }

            }

            posted on 2010-02-25 14:47 天書 閱讀(2125) 評(píng)論(0)  編輯 收藏 引用

            只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理



            <2010年1月>
            272829303112
            3456789
            10111213141516
            17181920212223
            24252627282930
            31123456

            常用鏈接

            留言簿(5)

            隨筆檔案

            文章分類

            文章檔案

            好友的Bolg

            搜索

            •  

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            国产精品美女久久久久网| 国产精品免费久久久久电影网| 久久久久国产视频电影| 看全色黄大色大片免费久久久| 深夜久久AAAAA级毛片免费看| 国产精品亚洲综合久久| 久久婷婷五月综合国产尤物app| 国产美女久久久| 国内精品久久久久影院老司| 97久久超碰国产精品2021| 欧美久久精品一级c片片| 亚洲国产综合久久天堂| 久久综合香蕉国产蜜臀AV| 久久国产成人午夜aⅴ影院| 久久久久久夜精品精品免费啦 | 久久精品国产亚洲AV影院| 成人国内精品久久久久一区| 久久久久国产一区二区三区| 狠狠88综合久久久久综合网| 亚洲AV伊人久久青青草原| 久久精品国产免费一区| 色综合久久天天综线观看| Xx性欧美肥妇精品久久久久久| 色欲久久久天天天综合网| 国内精品久久久久久不卡影院 | 久久久久久夜精品精品免费啦| 久久人搡人人玩人妻精品首页 | 最新久久免费视频| 成人精品一区二区久久| 国产亚洲婷婷香蕉久久精品| 亚洲午夜久久久久久久久久| 久久国内免费视频| 免费一级做a爰片久久毛片潮| 99热成人精品免费久久| 精品国产热久久久福利| 精品久久人人爽天天玩人人妻| 97久久精品人人澡人人爽| 久久亚洲精品视频| 国产精品久久久久一区二区三区| 久久成人精品视频| 国产韩国精品一区二区三区久久|