Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Wed Jun 26, 2002 5:04 pm Post subject: HTTP - Webserver |
|
|
Hello,
I've made a HTTP - server with the use of Tommy's vdsinet.dll
Here is the source:
| Code: |
external vdsinet.dll,Public Freeware Key|90257236
NET SOCKET,PORT,80
NET SOCKET,SERVER
NET SOCKET,VDSEVENTS
DIALOG CREATE,New Dialog,-1,0,568,160
DIALOG ADD,EDIT,EDIT1,16,25,,,EDIT1
DIALOG ADD,EDIT,EDIT2,45,40,,,@path(%0)
DIALOG ADD,EDIT,EDIT3,83,42,,,EDIT3
DIALOG ADD,BUTTON,BUTTON1,118,38,64,24,BUTTON1
DIALOG ADD,LIST,LIST1,8,248,296,144
DIALOG SHOW
:evloop
%%event = @event()
if @equal(%%event,)
goto next-evloop
else
goto %%event
end
:next-evloop
%%socketdata = @net(socket,data)
%%socketevent = @net(socket,event)
%%socketsenderid = @net(socket,senderid)
if @not(@null(%%socketdata))
list add,list1,%%socketdata - %%socketsenderid
option fieldsep,@chr(32)
parse "%%var1;%%var2;%%var3;%%var4;%%var5",%%socketdata
%%command = @substr(%%socketdata,1,3)
if @equal(%%command,GET)
goto sendhtmlfile
end
end
if @not(@null(%%socketevent))
list add,list1,%%socketevent - %%socketsenderid
end
goto evloop
:sendhtmlfile
%%htmlfile = %%var2
%%htmlfile = @substr(%%htmlfile,2,@len(%%htmlfile))
option fieldsep,@chr(63)
parse "%%htmlfile;%%parameters",%%htmlfile
list create,1
list loadfile,1,@dlgtext(edit2)%%htmlfile
net socket,sendid,%%socketsenderid,@text(1)
net socket,closecid,%%socketsenderid
list close,1
goto evloop
:button1button
net socket,sendall,@dlgtext(edit1)
list add,list1,@dlgtext(edit1)
goto evloop
:Close
exit
|
If you have some suggestions, please post a repley |
|