un source
Code : Tout sélectionner
;- Window Constants
Enumeration
#Window_0
EndEnumeration
;- Gadget Constants
Enumeration
#String_0
#Button_0
EndEnumeration
Procedure.s OpenURL(Url.s, OpenType.b)
isLoop.b = 1
INET_RELOAD.l = $80000000
hInet.l = 0 : hURL.l = 0 : Bytes.l = 0
Buffer.s = Space(2048)
hInet = InternetOpen_("PB@INET", OpenType, #Null, #Null, 0)
hURL = InternetOpenUrl_(hInet, Url, #Null, 0, INET_RELOAD, 0)
Repeat
Delay(1)
InternetReadFile_(hURL, @Buffer, Len(Buffer), @Bytes)
If Bytes = 0
isLoop = 0
Else
res.s = res + Left(Buffer, Bytes)
EndIf
Until isLoop = 0
InternetCloseHandle_(hURL)
InternetCloseHandle_(hInet)
ProcedureReturn res
EndProcedure
HTML.s = OpenURL("http://www.monip.org/", 1)
debut.l = FindString(HTML, "<BR>IP : ", 1) + 9
fin.l = FindString(HTML, "<br>", 1)
ip.s = Mid(HTML, debut, (fin - debut))
If OpenWindow(#Window_0, 0, 0, 205, 70, "IP Public", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_TitleBar)
SetWindowColor(#Window_0, RGB(0, 0, 0))
TextGadget(#String_0, 10, 10, 185, 20, "" + ip.s, #PB_Text_Center)
SetGadgetColor(#String_0, #PB_Gadget_BackColor, RGB(0, 0, 0))
SetGadgetColor(#String_0, #PB_Gadget_FrontColor, RGB(255, 255, 255))
HyperLinkGadget(#Button_0, 5, 40, 200, 20, " cliquez pour copier dans le presse papier", RGB(255, 0, 0))
SetGadgetColor(#Button_0, #PB_Gadget_BackColor, RGB(0, 0, 0))
SetGadgetColor(#Button_0, #PB_Gadget_FrontColor, RGB(255, 255, 255))
EndIf
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_Event_Gadget
Select EventGadget()
Case #Button_0
SetClipboardText(ip.s)
End
EndSelect
EndIf
Until EventID = #PB_Event_CloseWindow
ou plus court :
quelques infos sur la carte reseau ( Ar-s pour completer ton prg

)
Code : Tout sélectionner
prg=RunProgram("cmd.exe", "?/c ipconfig /all", "", #PB_Program_Open|#PB_Program_Read)
If prg
While ProgramRunning(prg)
Debug ReadProgramString(prg)
Wend
EndIf
CloseProgram(prg)
de nituvius
Code : Tout sélectionner
InitNetwork()
UserIPViewer$="http://h3x0r.ath.cx/Sonstiges/ShowMyIp12.php"
UserIP$ = StringField(GetHTTPHeader(UserIPViewer$), 2, Chr(34))
Debug UserIP$
