English
Forum

Ping Tool from CMD

 

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  
 




Sebastian
Sprenger
Hello and cordial Welcome, Tony!

really there same several Opportunities. The best would for each DrawText another position To take, z.B.
CompileMarkSeparation
DrawText 25,40,"Server..."
DrawText 25,65,"Client..."
DrawText 25,90,"Google..."re>
alternatively could you too

before each Cls one WaitInput settle or
The Texts with Print write. (so ersparst You you of course, new Coordinates conceive/-calculate To must, are but too on The type FixedSys/Courier tied).

Greeting, Sebastian
 
Profan² 7.0e, XProfan 9, 11.2a, FreeProfan32
Windows Vista Home Premium 32-Bit, 2.8 Ghz, 4 GB RAM
Windows Me, 1.8 Ghz, 256 MB RAM
07/20/08  
 




Rolf
Koch
there's many Opportunities. an speedy here:
CompileMarkSeparation
declare pingstring$,ping$,ping%
set("truecolor",1)

proc clearsection

    parameters xx.x&,yy.y&
    TextColor RGB(255,255,255),RGB(255,255,255)
    DRAWTEXT xx.x&,yy.y&,Space$(150)

endproc

CLS
ping%=1

if ping%=1

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

else

    TextColor RGB(255,0,0),-1
    DRAWTEXT 25,10,"Google Nicht erreichbar"

endif

waitinput
clearsection 25,10 vorhandenen Bereich wieder überpinseln
waitinput
 
07/20/08  
 




Penguin
Tux
thanks for speedy Answer.

If I The first Possibility use, would it whom Text still only moreover right write, or crazy ichmich there?

to "Cls" one "Waitinput" To settle sound already rather, the should hot the first a input made go must before something deleted becomes.

Related to the "Print" had I, if it no trouble power, gladly nocheinmal something hither declared. means with the whom Schriften is me already clear.

The zeite mail light me there already More one, i'll something experiment.

Edit: The possibility of RoKo has not yet functions, i'll time moreover herumprobieren.
 


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




Sebastian
Sprenger
No, not further to right, separate moreover to under.
with DrawText must You Yes two numbers indicated. The first standing for X-position (how far right) and the second for Y-position (how far under). If the second number means larger is, becomes the Text too below attend.
CompileMarkSeparation
drawtext 25,40,"Server erreichbar"
>
The Difference between DrawText and Print is, that it these both numbers with Print not gives. If you write would:
CompileMarkSeparation
print "Server erreichbar"
print "Client erreichbar"
print "Google erreichbar"re>
attend these three Lines automatically among themselves.

very, moreover rumprobieren helps!
 
Profan² 7.0e, XProfan 9, 11.2a, FreeProfan32
Windows Vista Home Premium 32-Bit, 2.8 Ghz, 4 GB RAM
Windows Me, 1.8 Ghz, 256 MB RAM
07/20/08  
 




Penguin
Tux
Ahhh...
CompileMarkSeparation
drawtext 25,40,"Server erreichbar"
>

functions, it was only stupid of me the the window To small was , but it catches Yes eachone time small on.

OK, then would my erstes trouble resolved and I am wen this Community very pleased.

i think the my nächstes trouble not long on itself Waiting can, means Please this Thread not yet close.
 


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




Stefan
Landsberg
Hi,
somehow having we what together.
i'm 14, and I too to into Sommerferien one Program To write that some Ping inquire the network power and indicating whether The angepingte ip accessible is.

my trouble is only I not yet so correctly. to that program come be and To jetz only the PDF manuals red Have that with Profan² 6.6 thereby was.

To your question with the drawtext and print. I have the To jetz so resolved, I to the print commands simply locate written Have. so You can then too one x and a y koordinate indicate.

If I then Schonmal thereby be stell I too same to (@penguin: I hope you have nothing against it if I that in your Thread make *liebguck* )

i'm Stefan, 14 years old and go on in Gymnasium in the circle Gütersloh.
 
07/20/08  
 



Looks time your both  [...] 
 
07/20/08  
 




Penguin
Tux
Nächstes trouble:

I must The Schriftgöße one Textes Change the of "DrawText" outputted watts. the make I still sure over Coordinates, if so over which?

gives it Perhaps a list with often genutzten command? I must Yes otherwise over ands over again here post and the carry sure not to Übersichtlichkeit the Threads with.

thanks
Tony

Edit:
CompileMarkSeparation
UseFont "CANDARA",10,10,1,0,0
>
 


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




Rolf
Koch
Gib in the Profanhilfe simply time DrawText as Search one.
your question would through Usefont clarified.
 
07/20/08  
 




Stefan
Landsberg
Hi,

I Have me jetz time intense so engage and yet is (only) that out of here come:
CompileMarkSeparation
declare ping%,status$,ip$

Proc Ping

    declare pingdatei1$, pingdatei2$, pingstring$, ping$
    Parameters ip$
    let pingdatei1$="PINGTEST.TXT"
    let pingdatei2$="PING.BAT"
    let pingstring$="PING.EXE",ip$,">",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

********************************************************************
Beschreibung:
Es gibt zwar schon eine schnelle und schöne Onlineabfrage über API,
aber leider gibt die Funktion nur 1 für Online zurück, wenn
man über ein Standart DFÜ eingewählt ist.
Diese Prozedur ist halt nur etwas langsamer aber man kann sogar DSL
(also - keine DFÜ-Verbindung) oder das alte T-Online u.s.w abfragen!!
Vielen Dank für den (von mir veränderten) Quelltext der Prozedur:
Rolf Koch - Rokosoftware - Koblenz 2002
----------------------------------------------------------------------
HIER JETZT DER AUFRUF DER PROZEDUR:
PING ADRESSE,ERGEBNISDATEI,BATCHDATEI
Parameter
1.) Webadresse - eine immer vorhandene wie www.nic.de
Wenn die Prozedur verwendet wird muss die Variable ping%
global deklariert werden. An diese Variable wird folgender Wert übergeben:
Erreichbarkeit der IP         ---        Wert
-------------------------------------------------------
Nicht Erreichbar                        0
Erreichbar                             1
********************************************************
let ip$=@input$("Welche IP soll überprüft werden?","IP abfrage","127.0.0.1")
ping ip$

if equ(ping%,1)

    let status$="Erreichbar"

else

    let status$="Nicht erreichbar"

endif

MessageBox(ip$"   -   "status$,
07/20/08  
 




Paul
Glatz
You must ip$ + " - " + status$ write
 
07/20/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.490 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