I test this( ServerHelloWorld example) sample web server program.
Execute the above url, The CreateHtml.exe can create abc.html file,
How do I show the abc.htm file to the client browser?
Execute the above url, The CreateHtml.exe can create abc.html file,
How do I show the abc.htm file to the client browser?
B4X:
Sub Handle(req As ServletRequest, resp As ServletResponse)
mreq = req
mresp = resp
If req.GetParameter("create")="yes" Then
Dim js As Shell
Dim params As List: params.Initialize
params.Add("filename=abc.html")
js.Initialize("js","c:\test\CreateHtml.exe", params)
js.WorkingDirectory = File.DirApp
js.RunWithOutputEvents(-1)
Do While ProcessExists("CreateHtml.exe")=True
'Wait for the program to finish running
Loop
'The CreateHtml.exe can create abc.html file,
'How do I show the abc.htm file to the client?
'???????????????
End If
End Sub
Sub ProcessExists(ExeName As String) As Boolean
Dim Result As ShellSyncResult
Dim Sh As Shell
Sh.InitializeDoNotHandleQuotes("", "tasklist", Null)
Result = Sh.RunSynchronous(5000)
Return Result.StdOut.ToLowerCase.Contains(ExeName.ToLowerCase)
End Sub