Skip to content
AutoHotKey
2011.12.31 08:32

autohotkey) 핑테스트 프로그램

조회 수 18950 추천 수 0 댓글 1
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부



핑테스트-text입력금지3.exe

핑테스트 및 c:\pingtest.txt 에 파일을 기록합니다.

핑로스는 c:\pingloss.txt에 파일을 기록합니다.


핑테스트-text입력금지-창안나오게하는거2.exe

핑로스만 c:\pingloss.txt에 파일을 기록합니다.

핑로스 발생시 ip 갱신여부를 확인하여 원인에 대한 메시지를 출력합니다.


#noTrayicon


;#IfWinActive, 핑테스트 ahk_class AutoHotkeyGUI

;{

;BlockInput, On

;}


;MsgBox % GetOSVersion() 

ver= % GetOSVersion() 

GetOSVersion() 

VarSetCapacity(v,148), NumPut(148,v) 

DllCall("GetVersionEx", "uint", &v) 

OSVer:=NumGet(v,4)NumGet(v,8) 

OSName:= OSVer=61 ? "Windows 7" 

:(OSVer=60 ? "Windows Vista" 

:(OSVer=52 ? "Windows XP 64-Bit Edition" 

:(OSVer=51 ? "Windows XP" 

:(OSVer=50 ? "Windows 2000" 

:"Unknown")))) 

return OSName 

}

;msgbox, 바보


; ******************* 추가적인 내용이 필요한 부분

; * IP / 

; 1. 키보드 후킹 기능을 이용하여 Edit 입력란에 키보드 입력을 막는다.

; 2. 적절한 컬러를 넣는다.

; 3. 시작시 IP할당과 오류만 수집, 정상만 수집, 모두 수집의 옵션 설정을 추가한다.

; ******************* 이정도 기능적인 부분이 추가된다면 괜찮겠죠?



ip=%1%

StringLen, OutputVar, ip

;msgbox, %ip%

if ip<1

{

ip=164.124.101.2

; msgbox, 없다? %ip%

}

if ip>1

{

; msgbox, 있다? %ip%

}

;msgbox, %ip%



Gui, Add, Edit, x6 y40 w510 h350 readonly, 

;Gui, Add, Text, x6 y10 cBlue IP1, 로컬IP : %A_IPAddress1%

;Gui, Add, Text, x160 y10 cBlue IP2, 대상Ping : %ip%

;Gui, Add, Text, x320 y10 cBlue IP3, 저장위치 : C:\pingTest.txt

;Gui, Add, Text, x320 y25 cBlue IP3, 오류위치 : C:\pingloss.txt

Gui, Add, Text, x6 y10 cBlue, 로컬IP : %A_IPAddress1%

Gui, Add, Text, x160 y10 cBlue, 대상Ping : %ip%

Gui, Add, Text, x320 y10 cBlue, 저장위치 : C:\pingTest.txt

Gui, Add, Text, x320 y25 cBlue, 오류위치 : C:\pingloss.txt

Gui, Show, x398 y110 h400 w520, 핑테스트



loop

{

sleep, 2000

runwait, %comspec% /c "%systemroot%\system32\ping %ip% -n 1 > C:\Ping.txt",, hide

;FileRead, ping, C:\ping.txt

if (ver="Windows 7") or (ver="Windows Vista")

{

FileReadLine, ping, C:\ping.txt, 3

}

if (ver="Windows XP") or (ver="Windows XP 64-Bit Edition") or (ver="Windows 2000") or (ver="Unknown")

{

FileReadLine, ping, C:\ping.txt, 7

}


filedelete, C:\ping.txt

Ifinstring, Ping, Request

{


; pingline3=%pingline2%

; pingline2=%pingline1%

pingline1=%pingline%



if pingline3

{

pinglines=%pingline3%`n

}


if pingline2

{

pinglines=%pingline2%`n

}


if pingline1

{

pinglines=%pingline1%`n

}


pingline=%pinglines%%A_Mon%월 %A_MDay%일 %A_Hour%시 %A_Min%분 %A_Sec%초 Request TimeOut. 점검요망.

GuiControl, Text, Edit1, % pingline

FileAppend, %pingline%`n, C:\pingTest.txt

FileAppend, %pingline%`n, C:\pingloss.txt

; return

}


else

{

stringgetpos, pos1, ping, time

stringtrimleft, TTL, ping, %pos1%

stringgetpos, pos2, TTL, TTL

StringLeft, Time, TTL, %pos2%

Stringtrimleft, TTL, TTL, %pos2%

Stringtrimright, time, time, 1


timenum:=RegExReplace(time,"[^0-9]") 

if timenum=1

{


; pingline3=%pingline2%

; pingline2=%pingline1%

pingline1=%pingline%



if pingline3

{

pinglines=%pingline3%`n

}


if pingline2

{

pinglines=%pingline2%`n

}


if pingline1

{

pinglines=%pingline1%`n

}


pingline=%pinglines%%A_Mon%월 %A_MDay%일 %A_Hour%시 %A_Min%분 %A_Sec%초 자신의 컴퓨터 입니다.

GuiControl, Text, Edit1, % pingline

FileAppend, %pingline%`n, C:\pingTest.txt

}


else

{

; pingline3=%pingline2%

; pingline2=%pingline1%

pingline1=%pingline%



if pingline3

{

pinglines=%pingline3%`n

}


if pingline2

{

pinglines=%pingline2%`n

}


if pingline1

{

pinglines=%pingline1%`n

}



pingline=%pinglines%%A_Mon%월 %A_MDay%일 %A_Hour%시 %A_Min%분 %A_Sec%초 [ %ping% ]

SendMessage, 0x0C, 0, &pingline, Edit1, %A%

GuiControl, Text, Edit1, % pingline

FileAppend, %pingline%`n, C:\pingTest.txt

}

}


}


IP:

return


^R::

reload

return


GuiClose:

ExitApp

return


^X::

ExitApp

return


^#!`::

Winhide, 핑테스트 ahk_class AutoHotkeyGUI

return


^#!1::

Winshow, 핑테스트 ahk_class AutoHotkeyGUI

return



로그인 후 댓글쓰기가 가능합니다.

?
  • ?
    ㅎㅎ 2012.01.18 04:05

    164.124.101.2 파워콤껀데 KT껄로 IP전환할수잇거나 바꿔주실수있나요?????

     


List of Articles
번호 분류 제목 날짜 조회 수
87 AutoHotKey #ifwinactive & #ifwinexist 윈도우창 마다 핫키의 용도를 다르게 사용하는 방법 2011.02.14 16522
86 회로도전자부품 555 TIMER AM TRANSMITTER CIRCUIT(AM 송신 회로) 2015.12.01 3691
85 AVR 555 TIMER AM TRANSMITTER CIRCUIT(AM 송신 회로) file 2014.09.20 23297
84 컴퓨터잡담 AHK & my Address of Pointer and my Offset 2011.10.11 13183
83 컴퓨터잡담 Ahk Standard Library Collection, 2010 Sep (+Gui) ~ Libs: 100 3 2011.10.11 14189
82 AutoHotKey ahk) autohotkey controlgettext 이름을 마우스커서에 졸졸 따라다니게 하기 file 2014.04.01 12181
81 AutoHotKey ahk) autohotkey 글자 자르기 방법 2013.10.30 34671
80 AutoHotKey ahk) autohotkey 엑셀(Excel)에서 행값 증가시키기 2013.10.30 37413
79 AutoHotKey AHK) AUTOKEY 웹페이지 열지않고 소스 가져오기 또는 로그인 하기 14 2012.05.12 52951
78 AutoHotKey Ahk) ip할당 진단프로그램 file 2011.12.26 12119
77 AutoHotKey ahk) Send an email 메일발송하기 2018.01.17 9388
76 AutoHotKey AHK) 보안프로그램 등으로 화면복사(Printscreen) 안될때 사용방법 1 12 file 2012.11.21 47165
75 AutoHotKey ahk) 열려진 엑셀창의 값 불러오기 1 2013.10.30 32526
74 AutoHotKey ahk) 오토핫키 콤보박스 제어하기 file 2013.10.30 38175
73 AutoHotKey Ahk) 웹페이지 감시결과에 따라 마이피플로 글 전송하기 12 file 2013.01.06 44022
72 AutoHotKey ahk_l 웹페이지 앞, 뒤페이지 제어 예제소스 및 설명첨부 2011.02.22 17535
71 AutoHotKey ahk_l 과 com 의 이해 2011.02.22 17485
70 AutoHotKey AHK_L 예제소스 1 2011.02.10 17015
69 AutoHotKey ahk_l 웹페이지 파일로 저장한 뒤 불러와 필요한 부분 추출하여 출력하기 2011.02.22 16989
68 컴퓨터잡담 AHK_L) SysListView321 컨트롤 내용 추출하기 2011.10.07 9893
Board Pagination Prev 1 2 3 4 5 Next
/ 5

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소