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 3 -



Penguin
Tux

@tony
hm,
ne I mean behind the waitinput would the rather aufgehoben.
then becomes namely first your screen with the ergebnissen displayed.
and if one then a Key pressing appear the infotext.

as anregung for your Program:
- The font in the ergebnisfenster is quite langgezogen.can Perhaps Change.
- super would it too yet if The font ruddy would if The IP Not Available is.


well then werd I the time so make and bad what happens.

around the Font I will me concern.
not antwortende IP´s go already ruddy marked, mach time from www.google.de www.google.xy
 


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




Rolf
Koch
here another suggestion just so
CompileMarkSeparation
 $P+
SET("ERRORLEVEL",0)
********************** HINWEISE ********************************
CODE ERZEUGT MIT ROKOS OBJECT CREATOR 4.6a
DATUM  20.07.2008    um  18:56 Uhr
VERWENDETE PROFANVERSION IST 11.0ß S16-NT XPROFAN
CODE ERSTELLT UNTER WINDOWS VISTA
!!! Dieser Code wird von Roc immer neu erzeugt        !!!
!!! Erst bearbeiten, wenn alle Objekte erzeugt wurden !!!
!!! Verändern Sie ggf. feste Pfade in variable Pfade  !!!
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

DEF GETSYSCOLOR(1) !"USER32","GetSysColor"
DECLARE TEXT1&
DECLARE TEXT2&
DECLARE TEXT3&
DECLARE TEXT4&
DECLARE TEXT5&
DECLARE EDIT1&
DECLARE EDIT2&
DECLARE EDIT3&
DECLARE EDIT4&
DECLARE EDIT5&
DECLARE EDIT6&
DECLARE BUTTON1&
DECLARE BUTTON2&
WINDOWSTYLE 63
WINDOWTITLE "Online Status"
WINDOW 167,154-302,267
SET("TRUECOLOR",1)
DECLARE ENDE%
CLS GETSYSCOLOR(15)
USEFONT "MS Sans Serif",13,0,0,0,0
SETDIALOGFONT 1
Hier kann ggf. Ihr Menü hin
TEXT1& = CREATE("TEXT",%HWND,"Server",0017,0047,0070,0020)
TEXT2& = CREATE("TEXT",%HWND,"Client",0017,0077,0070,0020)
TEXT3& = CREATE("TEXT",%HWND,"Google",0017,0107,0070,0020)
TEXT4& = CREATE("TEXT",%HWND,"Prozess",0107,0017,0070,0020)
TEXT5& = CREATE("TEXT",%HWND,"Status",0197,0017,0070,0020)
EDIT1& = CREATE("EDIT",%HWND,"",0107,0047,0067,0020)
EDIT2& = CREATE("EDIT",%HWND,"",0107,0077,0067,0020)
EDIT3& = CREATE("EDIT",%HWND,"",0107,0107,0067,0020)
EDIT4& = CREATE("EDIT",%HWND,"",0197,0047,0067,0020)
EDIT5& = CREATE("EDIT",%HWND,"",0197,0077,0067,0020)
EDIT6& = CREATE("EDIT",%HWND,"",0197,0107,0067,0020)
BUTTON1& = CREATE("BUTTON",%HWND,"beenden",0017,0197,0265,0030)
BUTTON2& = CREATE("BUTTON",%HWND,"Status checken",0017,0157,0129,0030)
SETFOCUS(%HWND)
REPAINT

WHILENOT ENDE%

    WAITINPUT

    If %KEY=2

        ENDE%= 1

    ELSEIF %KEY=4

    ELSEIF GETFOCUS(BUTTON1&) BUTTON

        ende%=1

    ELSEIF GETFOCUS(BUTTON2&) BUTTON

        settext edit4&,""
        settext edit5&,""
        settext edit6&,""
        settext edit1&,"ermittele"
        settext edit2&,"wartend"
        settext edit3&,"wartend"
        Ping "127.0.0.1","PINGTEST.TXT","PING.BAT"

        if ping%=1

            settext edit4&,"erreicht"

        else

            settext edit4&,"fehler"

        endif

        settext edit1&,"fertig"
        settext edit2&,"ermittele"
        settext edit3&,"wartend"
        Ping "192.168.0.1","PINGTEST.TXT","PING.BAT"

        if ping%=1

            settext edit5&,"erreicht"

        else

            settext edit5&,"fehler"

        endif

        settext edit1&,"fertig"
        settext edit2&,"fertig"
        settext edit3&,"ermittele"
        Ping "https://www.google.de","PINGTEST.TXT","PING.BAT"

        if ping%=1

            settext edit6&,"erreicht"

        else

            settext edit6&,"fehler"

        endif

        settext edit3&,"fertig"

    <
s=s4 href='./../../function-references/XProfan/endif/'>ENDIF ENDWHILE
 
07/20/08  
 




Penguin
Tux
there kannich indeed same whom code take, but since I it yourself on The legs to put wants. About ne Gui can I me any time thoughts make.

I werd then now time the try, I The whole Time already porbieren wants.
 


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




Rolf
Koch

there kannich indeed same whom code take, but since I it yourself on The legs to put wants. About ne Gui can I me any time thoughts make.

I werd then now time the try, I The whole Time already porbieren wants.


completely right attitude! but there here ask of because of createtext and Co come along, hättet your ne small reference
 
07/20/08  
 




Penguin
Tux

CompileMarkSeparation
power quite nothing, except me 2 Error-informations give. its, think I, neither I Search, it should specific for fehlgeschlagenen step showing. I have with straight consider, that one to the fehlgeschlagenen step a manner Link to a Helpfile settle could.

I such time in the Help to Ner Possibility left su settle, but I had too nothing against it, if here Schonmal someone something moreover write could.
 


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



Syntaxfehler, Strinkonstanten are with " To umschliessen.

print "Hallo Welt", not print Hello world.
 
07/20/08  
 




Rolf
Koch
you have again The quotation marks forget.
CompileMarkSeparation
print "Der Infotext"
print "Alles OK"e>
 
07/20/08  
 




Stefan
Landsberg
@tony
sorry I Have none seen that You for Not Available already ruddy as colour chosen have.

@rolf
I can your quelltext (to that Luck) not use, because I profane 6.6 Have. I wills too rather self zusammenbasteln. and if I NEN month for need

The first fehlermaeldung The with at perform displayed becomes is, that the order SET not famous is. as far as i know is it with profane 6.6 too yet createtext and not simply create. nevertheless thanks for your trouble.
 
07/20/08  
 




Rolf
Koch
@Stefan
said I already, that this a super attitude is?
As I said only to reference.
Well to that Happiness but only on the reference of Selbstmachen, or? because What is 6.6 because already against The actually Version *lol*
 
07/20/08  
 




Stefan
Landsberg
Yes I know the profane 6.6 to XProfan 11 plenty less To afford has. but in the beginning reichts yet loosly from. if I then first a little bit rather program can fetch I me Perhaps The neuste Version.

yet ne small question: have you got Perhaps from the object creator yet ne old Version The with profane 6.6 functions or must I hold without get along?
 
07/20/08  
 




Dietmar
Horn
ROC functions too with Profan² 6.6
 
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/20/08  
 




Penguin
Tux
well the it the Error unterlaufen is, there can me the nciht More occur

How sees the now with the left from? is the at all possible?
 


OS: Win XP/Debian
XProfan 10
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.386 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