Web服务

有了Foxtable,你可以用非常简单的代码搭建一个Web服务,无需任何专业知识。

1、开启HTTP服务:

HttpServer.Prefixes.Add("http://*/")
HttpServer
.Start()

2、HttpRequest事件代码:

Dim fl As String = "d:\web\" & e.path
If
filesys.FileExists(fl)
    Dim idx As Integer = fl.LastIndexOf(".")
    Dim ext As String  = fl.SubString(idx)
    Select Case ext
        Case ".jpg",".gif",".png",".bmp",".wmf",".js",".css" ,".html",".htm",".zip",".rar" 
            e.WriteFile(fl)
            Return
'
这里必须返回
    End
Select

End
If