and PG level projects,mini projects and many more here ...

Visual basic Code for Reply html content that is created by the server

Public Sub SendFile(intSocketIndex As Integer, strFileName As String)

Dim FileNo As Integer

Dim strbuf

' Make sure the file exists...

If Len(Dir(SwapPath(strFileName))) <> 0 Then

' open the file

FileNo = FreeFile()

Open SwapPath(strFileName) For Binary Access Read As #FileNo

' Read the data

strbuf = Input(LOF(FileNo), #FileNo)


' close the file

Close #FileNo

' Send the data

sckServer(intSocketIndex).SendData strbuf

ElseIf strFileName <> App.Path & "\FileNotFound.html" Then

' the file not found html file was found

SendFile intSocketIndex, App.Path & "\FileNotFound.html"


' No 'file not found' file. tell them...

sckServer(intSocketIndex).SendData "<html><body>Unable to find the file not found file.</body></html>"

End If

End Sub