Jim wrote:
Hello,
After downloading a file, my WinForms application needs to run a PHP
script online. This PHP script deletes the downloaded file from the
online server.
How can I program my application to use a thread or something similar to
call this PHP script in the background? I don't want to use
Process.Start as that would open up a browser window.
Thank you for your time,
Jim
Net namespace of the framework has various classes to do web requests.
If you use HttpWebRequest, it might work, try it:
using System.Net;
WebRequest r = WebRequest.Create("http://something.com/some.php");
if the server is configured to execute php before serving, it will
execute php before sending a response.
I have not tried it, so you might have to add a response to this too to
actually execute:
(code following previous one)
WebResponse res = r.GetResponse();
res.Close();
Laimis