AndyAlexander Posted January 21, 2003 Posted January 21, 2003 I'm trying to fill a simple web form in with vb .net, and have found numerous samples in VB6, however I can't seem to work out the same in vb .net. I can add the explorer object and navigate to the page, however when I try to use the AxWebBrowser1.documents collection I don't have access to the 'all' or 'forms' objects that the VB6 examples uses. Any help very gratefully received. Andy Quote
JPG-Force Posted December 20, 2003 Posted December 20, 2003 Have the same problem! please post anything you know about this problem because i have no further information and need one ... mfG JPG Quote
Celeron Posted March 24, 2004 Posted March 24, 2004 I don't have the same problem, using VB.NET and VS.NET 2003 AxWebBrowser.Document.all("fieldname").value = Value However, if you are continuing to have problems, there is another option. I'm going to assume you are trying to POST data, since that requires a more advanced function. Create a new System.Net.WebClient object. Public Class MyWebClient Public Client As New System.Net.WebClient Public Function HTTPRequest(ByVal URL As String, ByVal postString As String, Optional ByVal Method As String = "POST") As String Dim serverResponse() As Byte Dim postBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(postString) Try serverResponse = Me.Client.UploadData(URL, Method, postBytes) ' Gets data from server! Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, ex.Source & " Error") Exit Function End Try Dim responseHTML As String = (System.Text.Encoding.ASCII.GetString(serverResponse)) ' Turns server response(in bytes) into a string(HTML) Return responseHTML End Function End Class postString are your field arguments, the format for postString is as such "fieldname=value&fieldname2=value2&ect=ect&ect=ect" Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.