Re: Automating dialog with web server from VB.NET
From: Mark Gross (mgross_at_deq.state.id.us)
Date: 04/08/04
- Next message: Art DeBuigny: "Drop Down List Box Asp.net (VB)"
- Previous message: kyle: "vb.net 2003 module sub main()"
- In reply to: Peter Huang: "RE: Automating dialog with web server from VB.NET"
- Next in thread: Peter Huang: "Re: Automating dialog with web server from VB.NET"
- Reply: Peter Huang: "Re: Automating dialog with web server from VB.NET"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 08 Apr 2004 13:03:11 -0600
Peter,
My application is a Windows form, using VB.NET. The target web application
that I wish to control is a Lotus Notes application, served from a Domino
server.
I have used the example provided below, and it does not succeed for me. Part
of the problem was learning how to handle the firewall proxy server.
The folks at Dart.Com (PowerTCP) have a web address which posts back whatever
parameters you send it, and it appears I am sending everything correctly.
I am uncertain however about a couple of things. I download the initial dialog
web
page which contains the following:
<FORM METHOD=post ACTION="/names.nsf?Login" NAME="_DominoForm">
I a using the ACTION value to post back to. Do I need to do anything with the
NAME value?
<INPUT TYPE=hidden NAME="%%ModDate" VALUE="0000000000000000">
In parsing this out, is "%%" supposed to be replaced by something, or returned
literally?
<INPUT NAME="RedirectTo" VALUE="/defaultweb.nsf/mainframeset.htm"
type=hidden></FORM>
If this is a redirect, is there anything special that needs to be done in
retrieving the results?
Thanks for your help,
mark
Peter Huang wrote:
> Hi Mark,
>
> First of all, I would like to confirm my understanding of your issue.
> From your description, I understand that you wants to post some data to a
> names.nsf page.
> Have I fully understood you? If there is anything I misunderstood, please
> feel free to let me know.
>
> Since I have no Lotus Notes web application at hand, I test on an aspx page.
> Here is my code on client.
> Imports System.Net
> Imports System.Collections.Specialized
> Imports System.Text
> Module Module1
> Sub Main()
> 'Dim o As New TestCls.TestABC
> 'Console.WriteLine(o.Hello)
> Console.Write(ControlChars.Cr + "Please enter the URL to post data
> to : ")
> Dim uriString As String =
> "http://localhost/WebApplication6/WebForm1.aspx"
> ' Create a new WebClient instance.
> Dim myWebClient As New WebClient
> ' Create a new NameValueCollection instance to hold some custom
> parameters to be posted to the URL.
> Dim myNameValueCollection As New NameValueCollection
> Console.WriteLine("Please enter the following parameters to be
> posted to the Url")
> Console.Write("Name:")
> Dim name As String = "TestUser"
> Console.Write("Age:")
> Dim age As String = ""
> Console.Write("Address:")
> Dim address As String = ""
> ' Add necessary parameter/value pairs to the name/value container.
> myNameValueCollection.Add("Name", name)
> myNameValueCollection.Add("Address", address)
> myNameValueCollection.Add("Age", age)
> Console.WriteLine(ControlChars.Cr + "Uploading to {0} ...",
> uriString)
> ' Upload the NameValueCollection.
> Dim responseArray As Byte() = myWebClient.UploadValues(uriString,
> "POST", myNameValueCollection)
> ' Decode and display the response.
> Console.WriteLine(ControlChars.Cr + "Response received was :" +
> ControlChars.Cr + "{0}", Encoding.ASCII.GetString(responseArray))
> End Sub
> End Module
>
> [aspx codebehind page]
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> 'Put user code to initialize the page here
> If Request.Form("Name") = "TestUser" Then
> Response.Write("OK")
> End If
> End Sub
>
> You may try my code first with an aspx page first to isolate the problem.
>
> Best regards,
>
> Peter Huang
> Microsoft Online Partner Support
>
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no rights.
- Next message: Art DeBuigny: "Drop Down List Box Asp.net (VB)"
- Previous message: kyle: "vb.net 2003 module sub main()"
- In reply to: Peter Huang: "RE: Automating dialog with web server from VB.NET"
- Next in thread: Peter Huang: "Re: Automating dialog with web server from VB.NET"
- Reply: Peter Huang: "Re: Automating dialog with web server from VB.NET"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|