• <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 天書 閱讀(2134) 評(píng)論(0)  編輯 收藏 引用

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



            <2010年4月>
            28293031123
            45678910
            11121314151617
            18192021222324
            2526272829301
            2345678

            常用鏈接

            留言簿(5)

            隨筆檔案

            文章分類

            文章檔案

            好友的Bolg

            搜索

            •  

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            色欲综合久久躁天天躁蜜桃| 狠狠色丁香久久综合五月| 久久久99精品成人片中文字幕| 成人久久精品一区二区三区| 国产女人aaa级久久久级| 久久精品青青草原伊人| 久久精品无码一区二区三区| 蜜臀久久99精品久久久久久| 无码人妻久久一区二区三区免费| 伊人久久综在合线亚洲2019| 久久久久久国产精品美女 | 久久久久久久女国产乱让韩| 狠狠色丁香婷婷久久综合不卡| 中文字幕精品无码久久久久久3D日动漫| 日日躁夜夜躁狠狠久久AV| 久久精品中文字幕有码| A狠狠久久蜜臀婷色中文网| 国内精品久久国产| 久久九九久精品国产免费直播| 久久国产精品成人免费| 久久精品国产亚洲AV嫖农村妇女| 亚洲精品99久久久久中文字幕| 国产亚洲美女精品久久久| 99久久人妻无码精品系列| 久久亚洲精品成人AV| 亚洲国产精品无码久久久秋霞2| 欧美成人免费观看久久| 久久男人AV资源网站| 久久久久无码精品| 久久久精品日本一区二区三区 | 亚洲αv久久久噜噜噜噜噜| 狠狠色丁香久久婷婷综合蜜芽五月 | www久久久天天com| 国产99精品久久| 久久福利青草精品资源站| 国产精品久久久久9999高清| 久久精品亚洲精品国产色婷| 奇米综合四色77777久久| 久久久久国产精品熟女影院 | 伊人久久大香线蕉综合热线| 精品久久久一二三区|