RE: Automating dialog with web server from VB.NET
From: Peter Huang (v-phuang_at_online.microsoft.com)
Date: 04/08/04
- Next message: yEaH rIgHt: "Re: Question about Inherit UserControl"
- Previous message: Sueffel: "C++ DIB's"
- In reply to: Mark Gross: "Automating dialog with web server from VB.NET"
- Next in thread: Mark Gross: "Re: Automating dialog with web server from VB.NET"
- Reply: Mark Gross: "Re: Automating dialog with web server from VB.NET"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 08 Apr 2004 03:25:32 GMT
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: yEaH rIgHt: "Re: Question about Inherit UserControl"
- Previous message: Sueffel: "C++ DIB's"
- In reply to: Mark Gross: "Automating dialog with web server from VB.NET"
- Next in thread: Mark Gross: "Re: Automating dialog with web server from VB.NET"
- Reply: Mark Gross: "Re: Automating dialog with web server from VB.NET"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|