• 大小: 0.05M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-14
  • 语言: C#
  • 标签: IP  ping  网络  网站  地址  

资源简介

就是一个判断本机与某个IP地址、某个电脑是否连通,从而可以判断本机是否在某个网段上,也可以通过ping外网的地址来判断本机是否连网,也可以用来检测某个网站是否还存在可以访问。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net.NetworkInformation;
using System.Net;
namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void button1_Click(object sender EventArgs e)
        {
           
            Ping ping = new Ping();
            PingOptions options = new PingOptions();
            options.DontFragment = true;
            string data = ““;                 //ping内容
            byte[] buffer = Encoding.UTF8.GetBytes(data);
            int t

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件       11776  2017-08-19 11:48  WindowsFormsApplication2.v11.suo
     目录           0  2017-08-19 11:48  WindowsFormsApplication2\
     文件         189  2017-08-19 11:48  WindowsFormsApplication2\App.config
     目录           0  2017-08-19 11:48  WindowsFormsApplication2\bin\
     目录           0  2017-08-19 11:50  WindowsFormsApplication2\bin\Debug\
     文件        9728  2017-08-19 13:20  WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.exe
     文件         189  2017-08-19 11:48  WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.exe.config
     文件       26112  2017-08-19 13:20  WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.pdb
     文件       22984  2017-08-19 13:23  WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.vshost.exe
     文件         189  2017-08-19 11:48  WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.vshost.exe.config
     文件         490  2017-03-19 05:00  WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.vshost.exe.manifest
     文件        1218  2017-08-19 13:20  WindowsFormsApplication2\Form1.cs
     文件        4002  2017-08-19 13:20  WindowsFormsApplication2\Form1.Designer.cs
     文件        5817  2017-08-19 13:20  WindowsFormsApplication2\Form1.resx
     目录           0  2017-08-19 11:48  WindowsFormsApplication2\obj\
     目录           0  2017-08-19 13:20  WindowsFormsApplication2\obj\Debug\
     文件         867  2017-08-19 11:48  WindowsFormsApplication2\obj\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        7214  2017-08-19 11:48  WindowsFormsApplication2\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件           0  2017-08-19 11:48  WindowsFormsApplication2\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
     文件           0  2017-08-19 11:48  WindowsFormsApplication2\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
     文件           0  2017-08-19 11:48  WindowsFormsApplication2\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
     目录           0  2017-08-19 11:48  WindowsFormsApplication2\obj\Debug\TempPE\
     文件        1302  2017-08-19 13:23  WindowsFormsApplication2\obj\Debug\WindowsFormsApplication2.csproj.FileListAbsolute.txt
     文件         975  2017-08-19 13:20  WindowsFormsApplication2\obj\Debug\WindowsFormsApplication2.csproj.GenerateResource.Cache
     文件        2231  2017-08-19 12:06  WindowsFormsApplication2\obj\Debug\WindowsFormsApplication2.csprojResolveAssemblyReference.cache
     文件        9728  2017-08-19 13:20  WindowsFormsApplication2\obj\Debug\WindowsFormsApplication2.exe
     文件         180  2017-08-19 13:20  WindowsFormsApplication2\obj\Debug\WindowsFormsApplication2.Form1.resources
     文件       26112  2017-08-19 13:20  WindowsFormsApplication2\obj\Debug\WindowsFormsApplication2.pdb
     文件         180  2017-08-19 11:50  WindowsFormsApplication2\obj\Debug\WindowsFormsApplication2.Properties.Resources.resources
     文件         536  2017-08-19 11:48  WindowsFormsApplication2\Program.cs
     目录           0  2017-08-19 11:48  WindowsFormsApplication2\Properties\
............此处省略7个文件信息

评论

共有 条评论