Forum | | | | - 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 |
| | | | |
| | | | | - Page 9 - |
| Rolf Koch | Have time my idea grade umgesetzt. some went kürzer, but it should Yes clear and simply declared his. what You yet make must: fit whom code again To Profanversion 6.6 on, I over the newest Interpreter tested have and add, inc and co not any more present are what about me now no Time More have. input through space separated! spending the Result results against in that Eingabefenster (could too assembled showing and not particular - How said Time To concise). can also through Schnelltippen his, I ne Kleinigkeit overlooking or forget have - but You must indeed what moreover contribute ^^
Declare-part:
declare ping%, btn%,end%,ipedit&,ipinhalt$,i%
declare characters$,zeichenalt$
Proc-part:
Proc Ping
Ping%=0
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 ping$="Antwort von":Ping%=1
WEND
CLOSE #3
Assign #1,pingdatei1$
Erase #1
ENDPROC
Def-part:
DEF GetSysColor(1) !"User32","GetSysColor"
Window create:
Window Style 63
Window Title "IP Checker"
Window @SUB(@DIV(%maxX,2),300),@SUB(@DIV(%maxY,2),250) - 600,500
Window 10,10-600,500
SetTrueColor 1
CLS GetSysColor(15)
ipedit&=@CreateMultiEdit(%HWnd,"",10,50,570,-200)
btn%=@CreateButton(%HWnd,"Überprüfen",250,260,100,30)
Whilenot end%
waitinput
if clicked(btn%)
characters$=""
zeichenalt$=""
ipinhalt$=GetText$(ipedit&)
if mid$(ipinhalt$,len(ipinhalt$),1) <> " " ensuring Abschlusszeichen
ipinhalt$=ipinhalt$+" "
endif
i%=1
whilenot i% = len(ipinhalt$)+1
characters$=mid$(ipinhalt$,i%,1)
inc i%
if characters$ <> " "
characters$=zeichenalt$+characters$
zeichenalt$=characters$
else
ping zeichenalt$ here Ping Result
if ping%=1
settext ipedit&,zeichenalt$+" is verfügbar"
else
settext ipedit&,zeichenalt$+" isn't verfügbar"
endif
zeichenalt$=""
endif
endwhile
endif
Endwhile
|
| | | | |
| | Stefan Landsberg | THANK YOU Rolf the only what Profan 6.6 bemängelt is the function clicked. but the Have I simply through getfocus supplant.
Have me jetz thoroughly with your code befasst and Have it understood
jetz must I it nurnoch somehow umändern so it of my is, and then must I it in my Program einarbeiten. |
| | | | |
| | Rolf Koch | Freut me, that You it adopted have and this too understood have! |
| | | | |
| | Stefan Landsberg | Hi,
I have jetz Rolfs code in my Program eingebunden. as i so ready was wished I only yet the characters of space on distribution umändern. there's me noticed, that to the with absätzen rather with @getlinecount and @getline$ release can.
To jetz sees the by me so from: [...]
but somehow comes the Program by me in ne endlosschleife and fäng, after it whom status the last ip outputted has, again from the first ip on. I know but simply not where my Error is.
PS: the design map I To improve.
Edit: be jetz already something moreover. the error lying in row 56. @getlinecount(ipinput%) supply a number in the millionenbereich. its means no endlosschleife. tappt im dunkeln lasts only very long! joke with Page: Why Gibts getlinecount so a grosse number back? I thought there's The zeilenanzahl on. and the lying with my tests with 2 To 4. and not millionenbereich! |
| | | | |
| | | Stefan Löwen
be jetz already something moreover. the error lying in row 56. @getlinecount(ipinput%) supply a number in the millionenbereich. its means no endlosschleife. tappt im dunkeln lasts only very long! joke with Page: Why Gibts getlinecount so a grosse number back? I thought there's The zeilenanzahl on. and the lying with my tests with 2 To 4. and not millionenbereich!
and very this is z.B. one completely new Topic - with a own Minimalbeispiel. ;) |
| | | | |
| | Stefan Landsberg | Dou you mean I should a new thread eröffnen or what wanted You me say? |
| | | | |
| | | Yes, Please. |
| | | | |
| | Stefan Landsberg | profane has what against me. jetz i was already thereby my trouble in a new thread To narrate and wished whom code post. there Have I the Program once more quick go through let, and what happens?!?
@GetLineCount gives whom right worth back
naja, I freu me rather, that it jetz goes and make moreover. i will latterly the 6 pages yet my erstes Program to feature |
| | | | |
| | | Exakt therefore my Please to that new Thread - there becomes one hereon hingewiesen one [...] abzuliefern - let time until end and lach... |
| | | | |
| | Stefan Landsberg | the story with the minimalbeispiel of Roland Hennrich kenn I already
but I had the program a little while ago at least 5 time tested and @getlinecount was broken
what about me wished no minimal example post, separate whom kompletten code (can but too minimal name ) Have means nothing changed and at a single blow I ment.
naja I must not so plenty write, otherwise war I my Program not any more on Page 6 |
| | | | |
| | | I found "Roland Hennrich" fit... |
| | | | |
| | | | - Page 10 - |
| | Stefan Landsberg | somehow is tmir the To unübersichtlich become. therefore I thought I make here moreover: [...]
hopefully störs none. |
| | | | |
|
AnswerTopic-Options | 23.552 Views |
Themeninformationenthis Topic has 9 subscriber: |