Webserver :)
Übersicht

dark19GastBetreff: Webserver :) |
![]() Antworten mit Zitat |
|
---|---|---|
Ich habe mal einen kleinen webserver programmiert.
Er hat schon ein paar Funktionen z.b Content Length ihr müsst nur wo ihr den code habt ein ordner "Index" erstellen und dort eure dateien rein copieren. Hier der Code: Code: [AUSKLAPPEN] Print "Lade..."
ser = CreateTCPServer(8000) If ser = 0 Then Print "Webserver konnte nicht geladen werden" WaitKey End Else Print "Fertig" EndIf Repeat client = AcceptTCPStream(ser) If client Then Repeat If l$="" Then a=1 l$ = ReadLine(client) If a=1 ab$=l$ a=0 EndIf Until l = "" anf=Instr(ab$,"/") En=Instr(ab$,"H",anf)-6 add$=Mid(ab$,anf,En) Print ab$ Print add$ If add$="/" Then add$="/index.html" WriteLine(client, "HTTP/1.1 200 OK") WriteLine(client, "Content-Type: text/html") WriteLine(client, "Content-Length: "+FileSize ("index"+add$)) WriteLine(client, "") file=OpenFile("index"+add$) While Eof(file)=0 li$=ReadLine(file) WriteLine(client,li$) Wend CloseFile file CloseTCPStream(client) EndIf Until KeyHit(1) CloseTCPServer(ser) End |
||
![]() |
Willi die Rübe |
![]() Antworten mit Zitat ![]() |
---|---|---|
Sowas hatte ich auch mal gemacht sogar mit Logs un allem, allerdings bin an dem Problem gescheitert, das der Server nicht bei IE funktioniert (auch wenn das eigentlich kein Problem ist) Sogar Bilder und Downloads hatte ich eingebaut. Ich werds demnächst mal hochladen.
Greetz PS: Was ist an Content Lenght eine Funktion? |
||
Ich habe keine Lösung, aber ich bewundere das Problem.
Tehadon Q6600, MSI Neo2-FR, 4GB Ram, nVidia 7800 GTX At the Farewell Party visit: MySpace | Homepage |
dark19Gast |
![]() Antworten mit Zitat |
|
---|---|---|
ach das ist son schnik schnak aber meist nur interassant bei eigenen programmen.
aIch bin gerade dabei bilder hizuzufügen |
||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group