Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 한글 악성코드
- Mouse Over
- TCP Socket
- c# 외부 프로그램 실행
- FTP Server/Client
- vbscript
- Python Win32 API
- 파이썬
- pdf 악성코드
- c# xml 파싱
- UDP Server/Client
- anti vm
- Python LoadLibrary
- c# 파일 읽기쓰기
- Hover Action
- 최순실 악성코드
- Universal ShellCode
- PPT Malware
- PowerShell
- 악성코드
- 파워쉘
- c# 파일명 변경
- Python GetProcAddress
- c# 디렉토리 파일 조회
- TCP Server/Client
- 파이썬 외부프로그램 실행
- c# 파일 IO
- VMware
- hex2bin
- c# 프로그램 종료
Archives
- Today
- Total
그냥저냥
Ping 프로그램 코드 본문
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; using System.Collections; using System.Net.NetworkInformation; namespace PingSensorAppliance { public partial class Form1 : Form { public ListViewItem li = null; public ListView lv = null; public Form1() { InitializeComponent(); } private void Form1_Load(object sender,EventArgs e) { int i=0; string[] strArr_IP = {IP 목록}; string[] strArr_Name = {호스트명}; while(true) { try { string[] arr = new string[3]; ListViewItem itm; arr[0] = strArr_IP[i]; arr[1] = strArr_Name[i]; arr[2] = pingConnect(strArr_IP[i]); itm = new ListViewItem(arr) listView1.Items.Add(itm); i++; } catch { break; } } } public string pingConnect(string ip) { try { Ping pingSender = new Ping(); PingOptions options = new PingOptions(); options.DontFragment = true; string data = "a"; byte[] buffer = Encoding.ASCII.GetBytes(data); int timeout = 120; PingReply reply = pingSender.Send(ip, timeout, buffer, options); if (reply.Status == IPStatus.Success) { return "OK"; } else { return "-"; } } catch (Exception ex){ return "Error"; } } } } | cs |
'Dev. > C#' 카테고리의 다른 글
XML 파싱 및 파일명 변경 (0) | 2016.12.28 |
---|
Comments