Re: Automating dialog with web server from VB.NET

From: Mark Gross (mgross_at_deq.state.id.us)
Date: 04/08/04


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.



Relevant Pages

  • Re: request, session and application not defined?
    ... System.Web is a built-in imported class and doesn't need a reference. ... You don't need Imports Microsoft.VisualBasic nor Imports System.Data, ... The problem is that you can't get the ServerVariables in a "regular" sub. ... work with certain server variables and I have been stopped cold. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: request, session and application not defined?
    ... when I tried changing the Request to HTTPRequest the diagnostic ... work with certain server variables and I have been stopped cold. ... Sub GetConfig() ... Imports System.Data ...
    (microsoft.public.dotnet.framework.aspnet)
  • sending file
    ... I have a client application that connects to a server and sends the ... Imports System.Text ... Class server ... Shared Sub getCsv(ByVal tcpCl As TcpClient, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: client close the socket. how the server knows?
    ... the server know that the socket is closed from the client side. ... > Private Delegate Sub UpdateListBoxDel(ByVal Data As String) ... > Private Sub Button1_Click(ByVal sender As System.Object, ...
    (microsoft.public.dotnet.languages.vb)
  • .Net remoting doesnt work in Wan area.
    ... i try to broadcast events raised in server to ... Public Sub DoSomething ... Dim del As ... Dim clientProv As New BinaryClientFormatterSinkProvider ...
    (microsoft.public.dotnet.framework)