Hi.
I'm checking whether webbrowser works in Arvixe webhosting.
I want to take screenshot of a website (for example google), but it does not generate anything.
My code below;
Code: C#
private void test3()
{
string strTargetURL = "http://www.google.com";
// Create a ThreadRunner object
ThreadRunner threadRunner = new ThreadRunner();
//Create a WebView through the ThreadRunner
WebView webView = threadRunner.CreateWebView();
threadRunner.Send(() =>
{
string strFile = Server.MapPath("~/test.jpg");
//Load Google's home page
webView.LoadUrlAndWait(strTargetURL);
//Capture screens-hot and save it to a file
webView.Capture().Save(strFile);
});
threadRunner.Dispose();
}
The server return successfully, and the test.jpg file was generated. But when I open test.jpg, it is blank.
Any advise?