English
Forum

Ping Tool from CMD

 
- Page 1 -



Penguin
Tux
Hi,

i want me ersteinmal present. my name is Tony, i'm 15 years old and visit a six-year secondary school in Chemnitz. Since I now Sommerferien have what about me nothing moreover To do have, have I me undertaken one small Netzwerkanalysetool To write. on the Search after a einfachen Programming-Language be I on XProfan punched.

I have everything nötige gedownloaded and installs, connect have I to one Pingcode sought and I this:
declare pingstring$,ping$,ping%
********************************************************************

Proc Ping

    Parameters nic$,pingdatei1$,pingdatei2$
    let pingstring$="PING.EXE",nic$,">",pingdatei1$
    Assign #6,pingdatei2$
    Rewrite #6
    Print #6,pingstring$
    Close #6
    WinExecwait(pingdatei2$,0)
    Assign #5,pingdatei2$
    Erase #5
    ASSIGN #3,pingdatei1$
    RESET #3
    Ping%=0

    WHILENOT EOF(#3)

        input #3,ping$
        ping$=mid$(ping$,1,11)
        case equ$(ping$,"Antwort von"):Ping%=1

    WEND

    CLOSE #3
    Assign #1,pingdatei1$
    Erase #1

ENDPROC

********************************************************************
Description:
it gives of course already a speedy and nice Onlineabfrage über API,
but unfortunately gives The function only 1 for Online back, if
one über one Standart DFÜ eingewählt is.
These procedure is hold only something slower but one can even DSL
(means - no DFÜ-link) or the old T-Online u.s.w inquire!!
everything with one star umrandete is important for The request
Rolf cook - Rokosoftware - Koblenz 2002
BEISPIEL
WINDOWSTYLE 31
Window 200,200-300,80
Windowtitle "Onlinstatus-check without Api"
Text Color RGB(0,0,255),-1
UseFont "TIMES NEW ROMAN",20,10,0,0,0
DRAWTEXT 40,10,"..momentum ermittele!"
HIER JETZT THE AUFRUF THE PROZEDUR:********************
PING ADRESSE,ERGEBNISDATEI,BATCHDATEI
Parameter
1.) Webadresse - a always available How www.nic.de
2.) Dateiname, in which Pingergebnis written becomes - becomes again deleted!
3.) Dateiname, circa Ping correctly aufzurufen. - becomes again deleted!
********************************************************
Text Color RGB(255,255,255),RGB(255,255,255)
DRAWTEXT 40,10,"                                "
UseFont "TIMES NEW ROMAN",25,20,1,0,0
Text Color RGB(0,0,255),-1
Ping "192.168.0.7","PINGTEST.TXT","PING.BAT"

if equ(ping%,1)

    DRAWTEXT 25,10,"Erreichbar"

else

    DRAWTEXT 25,10,"Nicht erreichbar"

endif

waitinput

Diesen code have I me to my Bedürfnissen zurechtgeschnitten and it sees How follows from. moreover should I The of me ausgedachte Funktionsweise explain.

its planned, I one Tool write, which possible simply a first Help for schoolboy and teacher bid. notice one User the it none Internetzugang has, lead it the Tool from, which the row to first whom Server anpingt, then a others Client the network and then yet a computer of outside (z.B. Date). If it with of/ one the steps no feedback gives, should a Message with hints to removal on the Bildschrim attend.

now to that code:
declare pingstring$,ping$,ping%

Proc Ping

    Parameters nic$,pingdatei1$,pingdatei2$
    let pingstring$="PING.EXE",nic$,">",pingdatei1$
    Assign #6,pingdatei2$
    Rewrite #6
    Print #6,pingstring$
    Close #6
    WinExecwait(pingdatei2$,0)
    Assign #5,pingdatei2$
    Erase #5
    ASSIGN #3,pingdatei1$
    RESET #3
    Ping%=0

    WHILENOT EOF(#3)

        input #3,ping$
        ping$=mid$(ping$,1,11)
        case equ$(ping$,"Antwort von"):Ping%=1

    WEND

    CLOSE #3
    Assign #1,pingdatei1$
    Erase #1

ENDPROC

WINDOWSTYLE 31
Window 200,200-500,80
Windowtitle "Onlinstatus-check without Api"
Text Color RGB(0,0,255),-1
UseFont "TIMES NEW ROMAN",20,10,0,0,0
DRAWTEXT 40,10,"..momentum ermittele!"
Text Color RGB(255,255,255),RGB(255,255,255)
DRAWTEXT 40,10,"                                "
UseFont "CANDARA",25,20,1,0,0
Ping "127.0.0.1","PINGTEST.TXT","PING.BAT"

if equ(ping%,1)

    Text Color RGB(0,255,0),-1
    DRAWTEXT 25,10,"Server Erreichbar"

else

    Text Color RGB(255,0,0),-1
    DRAWTEXT 25,10,"Server not erreichbar"

endif

Ping "192.168.0.1","PINGTEST.TXT","PING.BAT"

if equ(ping%,1)

    Text Color RGB(0,255,0),-1
    DRAWTEXT 25,10,"Client Erreichbar"

else

    Text Color RGB(255,0,0),-1
    DRAWTEXT 25,10,"Client not erreichbar"

endif

Ping "www.google.de","PINGTEST.TXT","PING.BAT"

if equ(ping%,1)

    Text Color RGB(0,255,0),-1
    DRAWTEXT 25,10,"Google Erreichbar"

else

    Text Color RGB(255,0,0),-1
    DRAWTEXT 25,10,"Google not erreichbar"

endif

waitinput

One trouble, which itself to Time auftut, is the fact the the Fensterinhalt not gelöcht becomes. that is the "Server Erreichbar", "Client Erreichbar" and "Google Erreichbar" übereinander written go, means need I a Possibility whom Content the Fensters to each step To delete. thereby be on

punched. Nutze I these Possibility to or. to "Server Erreichbar" becomes "Server Erreichbar" none displayed.

for a small Hilfestellung would I very grateful.

thanks
Tony
 


OS: Win XP/Debian
XProfan 10
07/20/08  
 



 
- Page 7 -



Penguin
Tux
I have now time "Def @Hide(1) @ShowWindow(@&(1), 0)" into else area written and behind it then whom code for the Window written. the Window appear of course, but whom Text from the Pingfenster copies it with in that Hilfefenster
 


OS: Win XP/Debian
XProfan 10
07/21/08  
 




Rolf
Koch
I Please you! read this whole Thread of in front To hinten through!
I wrote in detail what To DEF and Showwindow!
so come we on none green sprig.
Sezte now again your kmpl. code to go there and were To it correct watts - you hear unfortunately not the what you written becomes. not angry meant, but we're Tipps give, Please too from it learn. OK?
 
07/21/08  
 




Penguin
Tux
is correct, you're right. i'll today eh something longer on stay. there does it.
 


OS: Win XP/Debian
XProfan 10
07/21/08  
 




Jörg
Sellmeyer
Also should You you The courses in the Profanhilfe standing, and try the structure To understand, so one Program has.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
07/21/08  
 



Jörg Sellmeyer
Jörg Sellmeyer
erstellst You means one

a%=createText(...

must You it to the End of program again


the stops I but for a rumour! If the Elternfenster destroy becomes reicht the completely...


I had the just purposely not same "so" erwähnt. fundamentally ought to one always think about, items, which one created, again To freizugeben, particularly then, if these only "geborgt" are. (independent of it the windows one the abnimmt and z.B. "wild" with wm_destroy umsich throws... *g*)
 
07/21/08  
 




Dietmar
Horn
Hello P(i/e)nguin,

load you for beginning Perhaps simply time my XProfan-manager from the Download-area ours Vereins-Homepage down  [...] 

straight for XProfan-Beginner (too yet To down to actually Freeware-Version Profan² 6.6) shining the a true XProfan-repository To his, How me my XProfan-schoolboy over ands over again confirm. next to -zig Tools, DLLs, PCUs, INCs, Source-Helfern and over 2000 demonstration-Source code find You in this manager so almost quite everything, what it currently in the XProfan-scene gives. and even several Einführungskurse (a even from of my feather - if already something older and evtl. slight antiquated).

Greeting
Dietmar
 
Multimedia für Jugendliche und junge Erwachsene - MMJ Hoyerswerda e.V.  [...] 

Windows 95 bis Windows 7
Profan² 6.6 bis XProfan X2 mit XPSE

Das große XProfan-Lehrbuch:  [...] 
07/21/08  
 




Penguin
Tux
I Have me now time euren XPM gedownloaded, of whom I get now the Password? if I it of you get, would I very grateful if You me Message write would.
 


OS: Win XP/Debian
XProfan 10
07/22/08  
 




Dietmar
Horn
PM with XPM-PWD of me should with you meanwhile arrived his.

Greeting
Dietmar
 
Multimedia für Jugendliche und junge Erwachsene - MMJ Hoyerswerda e.V.  [...] 

Windows 95 bis Windows 7
Profan² 6.6 bis XProfan X2 mit XPSE

Das große XProfan-Lehrbuch:  [...] 
07/22/08  
 




Penguin
Tux
OK, The XPM is installs and I am straight thereby bich time bisschen to see.

to the actual trouble.

I have me now nocheinmal Rolfs Posts durchgelesen and come immernoch only so far, the the window of course appear, but the Text of Ergebnissfenster standing in the Hilfefesnter and this is Yes not the sense.
 


OS: Win XP/Debian
XProfan 10
07/22/08  
 




Rolf
Koch
OK, then since with your kmpl. code circa time To look. I go of it from, that You again The Handles verwechselst.
1x %hwnd and 1x Dlg&.
 
07/22/08  
 




Penguin
Tux
here only one shred  [...] 

I have me straight once more whom item To %hWnd angeguckt and I Pinned, that I %hWnd none in the beginning declariert have. means must I the still into Declare part write and then to whom commands to that open the Mainwindow - correctly.?
 


OS: Win XP/Debian
XProfan 10
07/22/08  
 




Rolf
Koch
Nagut bisschen changed:
CompileMarkSeparation
declare pingstring$, ping$, ping%

Proc Ping

    Parameters nic$,pingdatei1$,pingdatei2$
    let pingstring$="PING.EXE",nic$,">",pingdatei1$
    Assign #6,pingdatei2$
    Rewrite #6
    Print #6,pingstring$
    Close #6
    WinExecwait(pingdatei2$,0)
    Assign #5,pingdatei2$
    Erase #5
    ASSIGN #3,pingdatei1$
    RESET #3
    Ping%=0

    WHILENOT EOF(#3)

        input #3,ping$
        ping$=mid$(ping$,1,11)
        case ping$="Antwort von":Ping%=1

    WEND

    CLOSE #3
    Assign #1,pingdatei1$
    Erase #1

EndProc

WINDOWSTYLE 31
Window 200,200-500,180
Windowtitle "PiRePro by penguin"
TextColor RGB(0,0,255),-1
UseFont "TIMES NEW ROMAN",20,10,0,0,0
DRAWTEXT 40,10,"..moment ermittele!"
TextColor RGB(255,255,255),RGB(255,255,255)
DRAWTEXT 40,10,"                                "
UseFont "CANDARA",25,20,1,0,0
Ping "127.0.0.1","PINGTEST.TXT","PING.BAT"

if ping%=1

    TextColor RGB(0,255,0),-1
    DRAWTEXT 25,10,"Server Erreichbar"
    waitinput

else

    TextColor RGB(255,0,0),-1
    DRAWTEXT 25,10,"Server Nicht erreichbar" wird ja auf dem Hauptfenster angezeigt!
    Du kannst ja auch nur ein Hauptfenster haben mit WINDOW x,x-y,y
    also hier ein createdialog oder createwindow als Unterfenster (Kindfenster)
    Declare btndlg&,dlgende%,dlg&
    dlg&=Create("Window",%hwnd,"Hilfe",10,10,500,400)
    btnDlg& = CreateButton(dlg&,"OK",10,10,120,30)

    WhileNot dlgende%

        WaitInput

        If GetFocus(btnDlg&)

            dlgende% = 1

        EndIf

    Endwhile

endif

waitinput  lieber oben with ping%=1

and NEIN %hwnd must You do not declarieren, because % standing to the String hwnd - is means a solid Variable of Profan self! otherwise would it hwnd% lauten

means only one Mainwindow with %hwnd and Kindfenster by create("DIALOG"... or create("WINDOW".... (see Help) create!
 
07/22/08  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

24.384 Views

Untitledvor 0 min.
Georg Teles08/01/23
Thomas Freier10/06/22
Langer01/30/21
Walter01/29/19
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie