Making Textbox type into a textbox?
I'm a noob to VB.NET and I was wondering how to make something you type into a textbox on the application type that text into a we开发者_高级运维bsite textbox and submit whats in the textbox by pressing a button? I am using visual studio 2008.
That is a little tricky to do, but it is possible. However, without more details on the specific browser or what you are trying to copy over, you aren't going to get a lot of answers on here.
Better Suggestion: Have you considered instead of trying to control the browser via "voodoo", that you might just have your VB.NET application submit the form/request directly to the web server and cut out the middle-man (the browser)?
I'm assuming you're trying to POST data to a web form from some other application. Check this out; it's in C# but you can translate it to VB.NET. It uses a WebBrowser control and the SetAttribute method to set input values on the web form.
// C# WebBrowser browser; ... browser.Document.GetElementById("username").SetAttribute("value", "MyUsername"); ... form.InvokeMember("submit");
精彩评论