473,625 Members | 3,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Httpwebrequest to Submit multipart/form-data

I'm trying to write a program in vb.net to automate filling out a
series of forms on a website. There are three forms I need to
fill out in sequence. The first one is urlencoded. My program is
able to fill that one out just fine.

The second form is multipart/form-data. Unfortunately, I haven't
been able to fill that out in a way that makes the server happy.

I set up a copy of this form at my web site so that I could see
exactly what a browser sends to the server and compare that to
what my program sends. I saw a few mistakes in my program and I
fixed them, but the real web site still rejects my program's
submissions.

As best I can tell, the contents that my program submits are
identical to the contents submitted by a browser. Is there
anything else that might be causing my problem?
Thanks for any help.
--
Greg
----
greg -at- spencersoft -dot- com
Nov 21 '05 #1
10 4718
Gregory A Greenman wrote:
I'm trying to write a program in vb.net to automate filling out a
series of forms on a website. There are three forms I need to
fill out in sequence. The first one is urlencoded. My program is
able to fill that one out just fine.

The second form is multipart/form-data. Unfortunately, I haven't
been able to fill that out in a way that makes the server happy.

I set up a copy of this form at my web site so that I could see
exactly what a browser sends to the server and compare that to
what my program sends. I saw a few mistakes in my program and I
fixed them, but the real web site still rejects my program's
submissions.

As best I can tell, the contents that my program submits are
identical to the contents submitted by a browser. Is there
anything else that might be causing my problem?


Well, analyzing your problem from 10000' isn't that easy... can you provide
more details (code, error messages, ...)?

Cheers,

--
Joerg Jooss
www.joergjooss.de
ne**@joergjooss .de
Nov 21 '05 #2
What error message is it giving you? Is it looking for a specified set of
credentials, etc.?

Sean McCormack
Open Source for .NET
http://www.adapdev.org

"Gregory A Greenman" wrote:
I'm trying to write a program in vb.net to automate filling out a
series of forms on a website. There are three forms I need to
fill out in sequence. The first one is urlencoded. My program is
able to fill that one out just fine.

The second form is multipart/form-data. Unfortunately, I haven't
been able to fill that out in a way that makes the server happy.

I set up a copy of this form at my web site so that I could see
exactly what a browser sends to the server and compare that to
what my program sends. I saw a few mistakes in my program and I
fixed them, but the real web site still rejects my program's
submissions.

As best I can tell, the contents that my program submits are
identical to the contents submitted by a browser. Is there
anything else that might be causing my problem?
Thanks for any help.
--
Greg
----
greg -at- spencersoft -dot- com

Nov 21 '05 #3
In article <uD************ **@tk2msftngp13 .phx.gbl>,
jo*********@gmx .net says...
Gregory A Greenman wrote:
I'm trying to write a program in vb.net to automate filling out a
series of forms on a website. There are three forms I need to
fill out in sequence. The first one is urlencoded. My program is
able to fill that one out just fine.

The second form is multipart/form-data. Unfortunately, I haven't
been able to fill that out in a way that makes the server happy.

I set up a copy of this form at my web site so that I could see
exactly what a browser sends to the server and compare that to
what my program sends. I saw a few mistakes in my program and I
fixed them, but the real web site still rejects my program's
submissions.

As best I can tell, the contents that my program submits are
identical to the contents submitted by a browser. Is there
anything else that might be causing my problem?


Well, analyzing your problem from 10000' isn't that easy... can you provide
more details (code, error messages, ...)?


Okay. I'm getting "The remote server returned an error: (500)
internal server error".

I've got a form with two text boxes in the upper left corner,
txtHalfID and txtHalfPassword . There are three text boxes in the
upper right corner, txtISBN, txtDescription and txtPrice. There's
also a drop down combo in the upper right, cmbCondition.

The bottom portion of the screen has a read only multi line text
box called txtResponse, where the raw HTML from the server is
displayed.

Below the left text boxes is a button, btnSignOn. If you click
that button, it will sign you onto Half.com using the ID and
password in the textboxes above it. This part works fine for me.
I can see the "Welcome to eBay" page in txtResponse.

Below the right boxes is a button called btnListBook. When I
click on it it should call four web pages on half.com in order.

First it calls http://half.ebay.com/help/sell_books.cfm. It fills
in the field in the form there with txtISBN.

Next it calls http://half.ebay.com/cat/sell/pmsearch.cgi. It
fills out the form there with txtDescription and cmbCondition.
This form allows file uploads, so it's a multipart form. Although
my program's output looks good to me, I get that server error
when I submit this form.

Here's the code:

- Start Code ---------------------------------------------------
Imports System.Net

Public Class SBM
Inherits System.Windows. Forms.Form

Dim cc As New CookieCollectio n
Const encURL As Integer = 0
Const encMulti As Integer = 1

Private Sub SBM_Load(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles MyBase.Load
txtHalfID.Text = ""
txtHalfPassword .Text = ""

txtISBN.Text = "0764560255 "
txtDescription. Text = "good good"
txtPrice.Text = "99.99"

With cmbCondition
.Items.Add(New Conditions("Bra nd New", "830"))
.Items.Add(New Conditions("Lik e New", "840"))
.Items.Add(New Conditions("Ver y Good", "849"))
.Items.Add(New Conditions("Goo d", "859"))
.Items.Add(New Conditions("Acc eptable", "864"))
.SelectedIndex = 0
End With

cmbCondition.Se lectedIndex = 0
End Sub

Private Sub btnSignOn_Click (ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles btnSignOn.Click
Dim HWRequest As HttpWebRequest
Dim strURL As String
Dim HWParameters As Parameters
Dim intFound As Integer

HWRequest = GetRequest
("https://signin.ebay.com/ws/eBayISAPI.dll?S ignIn&UsingSSL= 1
&co_partnerid=2 &siteid=20")
strURL = "https://signin.half.eba y.com/ws/eBayISAPI.dll"

HWParameters = ReadResponse(HW Request, strURL)

intFound = 0

For Each p As Parameter In HWParameters
Select Case p.Name
Case "userid"
p.Value = txtHalfID.Text
intFound += 1
Case "pass"
p.Value = txtHalfPassword .Text
intFound += 1
End Select

If intFound = 2 Then
Exit For
End If
Next

HWRequest = PostRequest(str URL, HWParameters, encURL)
GetResponse(HWR equest)
End Sub

Private Sub btnListBook_Cli ck(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles btnListBook.Cli ck
Dim strPostData As String
Dim HWRequest As HttpWebRequest
Dim strURL As String
Dim HWParameters As Parameters
Dim intFound As Integer
Dim pr As Parameter

Try
HWRequest = GetRequest
("http://half.ebay.com/help/sell_books.cfm" )
strURL = "http://half.ebay.com/cat/sell/pmsearch.cgi"

HWParameters = ReadResponse(HW Request, strURL)

intFound = 0

For Each p As Parameter In HWParameters
Select Case p.Name
Case "p_code"
p.Value = txtISBN.Text
intFound += 1
End Select

If intFound = 1 Then
Exit For
End If
Next

HWRequest = PostRequest(str URL, HWParameters, encURL)

strURL = "/cat/sell/save_new_listin g.cgi"

HWParameters = ReadResponse(HW Request, strURL)
pr = New Parameter
pr.Name = "x"
pr.Value = 20
pr.Type = Parameter.Input
HWParameters.Ad d(pr)
pr = New Parameter
pr.Name = "y"
pr.Value = 20
pr.Type = Parameter.Input
HWParameters.Ad d(pr)
intFound = 0

For Each p As Parameter In HWParameters
Select Case p.Name
Case "notes"
p.Value = txtDescription. Text
intFound += 1
Case "condition"
p.Value = cmbCondition.It ems
(cmbCondition.S electedIndex).I temData
intFound += 1
End Select

If intFound = 2 Then
Exit For
End If
Next

strURL =
"http://half.ebay.com/cat/sell/save_new_listin g.cgi"

HWRequest = PostRequest(str URL, HWParameters,
encMulti)

strURL = "sell.jsp"
HWRequest.Refer er =
"http://half.ebay.com/cat/sell/pmsearch.cgi"
'the internal server error is generated in this call
'to ReadResponse
HWParameters = ReadResponse(HW Request, strURL)
intFound = 0

For Each p As Parameter In HWParameters
Select Case p.Name
Case "itemPrice"
p.Value = txtPrice.Text
intFound += 1
End Select

If intFound = 1 Then
Exit For
End If
Next

strURL = "http://half.ebay.com/cat/sell/sell.jsp"

HWRequest = PostRequest(str URL, HWParameters, encURL)

GetResponse(HWR equest)

MessageBox.Show ("Success!", MsgBoxStyle.OKO nly, "Book
Posted")

Catch ex As Exception
MessageBox.Show ("Error: " & ex.Message, "Error!!!",
MessageBoxButto ns.OK, MessageBoxIcon. Exclamation)

MsgBox("Half.co m appears to have changed its posting
procedures. As a result, this version of SBM cannot list books on
it.", MsgBoxStyle.Exc lamation, "Half.com Listing Problem")
End Try
End Sub

Private Function GetRequest(ByVa l strURL As String) As
HttpWebRequest
GetRequest = CreateRequest(s trURL)
GetRequest.Meth od = "GET"
End Function

Private Function PostRequest(ByV al strURL As String, ByVal
PostParameters As Parameters, ByVal intType As Integer) As
HttpWebRequest
Dim encoding As New System.Text.ASC IIEncoding
Dim byte1 As Byte()
Dim newStream As System.IO.Strea m
Dim strData As String
Const strBoundary As String =
"---------------------------7d4285126106b0"

PostRequest = CreateRequest(s trURL)
PostRequest.Met hod = "POST"

If intType = encURL Then
PostRequest.Con tentType = "applicatio n/x-www-form-
urlencoded"
Else
PostRequest.Con tentType = "multipart/form-data,
boundary=" & strBoundary
End If

strData = BuildRequestStr ing(PostParamet ers, intType,
strBoundary)

PostRequest.Con tentLength = strData.Length

byte1 = encoding.GetByt es(strData)

newStream = PostRequest.Get RequestStream
newStream.Write (byte1, 0, byte1.Length)
newStream.Close ()
End Function

Private Function BuildRequestStr ing(ByVal RequestParamete rs
As Parameters, ByVal intType As Integer, ByVal strBoundary As
String)
BuildRequestStr ing = ""

Select Case intType
Case encURL
For Each p As Parameter In RequestParamete rs
BuildRequestStr ing &= p.Name.Trim & "=" &
p.Value.Trim & "&"
Next

BuildRequestStr ing = Mid(BuildReques tString, 1,
Len(BuildReques tString) - 1)
Case encMulti
'the requeststring generated for the multipart form is
'shown below
For Each p As Parameter In RequestParamete rs
BuildRequestStr ing &= "--" & strBoundary &
vbCrLf & "Content-Disposition: form-data; name=""" & p.Name.Trim
& """"
Select Case p.Type
Case Parameter.File
BuildRequestStr ing &= ";
filename=""""" & vbCrLf & "Content-Type: application/octet-
stream" & vbCrLf & vbCrLf & vbCrLf
Case Parameter.Input
BuildRequestStr ing &= vbCrLf & vbCrLf
& p.Value & vbCrLf
End Select
Next
BuildRequestStr ing &= "--" & strBoundary & "--"
End Select
End Function

Private Function CreateRequest(B yVal strURL As String) As
HttpWebRequest
Dim Uri As Uri

Uri = New Uri(strURL)
CreateRequest = HttpWebRequest. Create(Uri)
CreateRequest.A llowAutoRedirec t = True
CreateRequest.C ookieContainer = New CookieContainer

If cc.Count > 0 Then
CreateRequest.C ookieContainer. Add(cc)
End If
End Function

Private Sub GetResponse(ByV al ReadRequest As HttpWebRequest)
Dim HWResponse As HttpWebResponse
Dim cookie As Cookie

HWResponse = ReadRequest.Get Response()

If HWResponse.Cook ies.Count > 0 Then
For Each cookie In HWResponse.Cook ies
cc.Add(cookie)
Next
End If

'debugging
Dim sr As System.IO.Strea mReader
Dim strResult As String

sr = New System.IO.Strea mReader
(HWResponse.Get ResponseStream( ))

txtResponse.Tex t = sr.ReadToEnd

sr.Close()
'debugging
End Sub

Private Function ReadResponse(By Val ReadRequest As
HttpWebRequest, ByVal ReadURL As String) As Parameters
Dim HWResponse As HttpWebResponse
Dim cookie As Cookie
Dim sr As System.IO.Strea mReader
Dim strResult As String
Dim intTagPos As Integer
Dim intLength As Integer
Dim intURLPos As Integer
Dim strTag As String
Dim blnFormFound As Boolean
Dim blnMoreForms As Boolean
Dim intPos As Integer
Dim strName As String
Dim strValue As String
Dim ReadParameter As Parameter
Dim intType As Integer
Dim intInputPos As Integer
Dim intTextPos As Integer
Dim intSelectPos As Integer
Dim blnTagFound As Boolean

ReadResponse = New Parameters
'the next line generates the internal server error
HWResponse = ReadRequest.Get Response()

If HWResponse.Cook ies.Count > 0 Then
For Each cookie In HWResponse.Cook ies
cc.Add(cookie)
Next
End If

sr = New System.IO.Strea mReader
(HWResponse.Get ResponseStream( ))

strResult = sr.ReadToEnd

'debugging
txtResponse.Tex t = strResult
'debugging

blnFormFound = False
blnMoreForms = True
intTagPos = 1

While Not blnFormFound And blnMoreForms
intTagPos = InStr(intTagPos , strResult.ToUpp er,
"<FORM", CompareMethod.T ext)

If intTagPos <> 0 Then
intLength = InStr(intTagPos , strResult, ">",
CompareMethod.T ext) - intTagPos
strTag = strResult.Subst ring(intTagPos,
intLength)

intURLPos = InStr(1, strTag.ToUpper,
ReadURL.ToUpper , CompareMethod.T ext)

If intURLPos <> 0 Then
intLength = InStr(intTagPos ,
strResult.ToUpp er, "</FORM>", CompareMethod.T ext) - intTagPos
strResult = strResult.Subst ring(intTagPos,
intLength)
blnFormFound = True
Else
intTagPos += 1
End If
Else
blnMoreForms = False
End If
End While

If blnFormFound Then
intTagPos = 1

While intTagPos <> 0
intInputPos = InStr(intTagPos , strResult.ToUpp er,
"<INPUT", CompareMethod.T ext)
intTextPos = InStr(intTagPos , strResult.ToUpp er,
"<TEXTAREA" , CompareMethod.T ext)
intSelectPos = InStr(intTagPos ,
strResult.ToUpp er, "<SELECT", CompareMethod.T ext)

intTagPos = IIf(intTextPos <> 0 And intTextPos <
intInputPos, intTextPos, intInputPos)
intTagPos = IIf(intSelectPo s <> 0 And
intSelectPos < intTagPos, intSelectPos, intTagPos)

intType = Parameter.Input

If intTagPos <> 0 Then
intLength = InStr(intTagPos , strResult, ">",
CompareMethod.T ext) - intTagPos
strTag = strResult.Subst ring(intTagPos,
intLength)

intPos = InStr(1, strTag.ToUpper,
"TYPE=SUBMI T", CompareMethod.T ext)
If intPos = 0 Then
intPos = InStr(1, strTag.ToUpper,
"TYPE=""SUBMIT" "", CompareMethod.T ext)
End If

If intPos = 0 Then
intPos = InStr(1, strTag.ToUpper,
"NAME=""", CompareMethod.T ext)

If intPos = 0 Then
intPos = InStr(1, strTag.ToUpper,
"NAME=", CompareMethod.T ext)
intLength = InStr(intPos + 5, strTag,
" ", CompareMethod.T ext) - intPos - 5
strName = strTag.Substrin g(intPos +
4, intLength)
Else
intLength = InStr(intPos + 6, strTag,
"""", CompareMethod.T ext) - intPos - 6
strName = strTag.Substrin g(intPos +
5, intLength)
End If

If intPos <> 0 Then
intPos = InStr(1, strTag.ToUpper,
"VALUE=""", CompareMethod.T ext)

If intPos = 0 Then
strValue = ""
Else
intLength = InStr(intPos + 7,
strTag, """", CompareMethod.T ext) - intPos - 7
strValue = strTag.Substrin g
(intPos + 6, intLength)
End If

intPos = InStr(1, strTag.ToUpper,
"TYPE=""FILE""" , CompareMethod.T ext)

If intPos = 0 Then
intPos = InStr(1, strTag.ToUpper,
"TYPE=FILE" , CompareMethod.T ext)
End If

intType = IIf(intPos = 0, intType,
Parameter.File)

ReadParameter = New Parameter
ReadParameter.N ame = strName
ReadParameter.V alue = strValue
ReadParameter.T ype = intType
ReadResponse.Ad d(ReadParameter )
End If
End If

intTagPos += 1
End If
End While
Else
Throw New System.Exceptio n("Form not found.")
End If
End Function
End Class

Public Class Parameters
Inherits System.Collecti ons.CollectionB ase

Public Sub Add(ByVal sFld As Parameter)
List.Add(sFld)
End Sub

Public ReadOnly Property Item(ByVal index As Integer) As
Parameter
Get
Return CType(List.Item (index), Parameter)
End Get
End Property
End Class


Public Class Parameter
Public Const Input As Integer = 0
Public Const File As Integer = 1

Dim strName As String
Dim strValue As String
Dim intType As Integer

Public Property Name() As String
Get
Return strName
End Get
Set(ByVal vName As String)
strName = vName
End Set
End Property

Public Property Value() As String
Get
Return strValue
End Get
Set(ByVal vName As String)
strValue = vName
End Set
End Property

Public Property Type() As Integer
Get
Return intType
End Get
Set(ByVal vType As Integer)
intType = vType
End Set
End Property
End Class
Public Class Conditions
Private strName As String
Private strID As String

Public Sub New()
strName = ""
strID = ""
End Sub

Public Sub New(ByVal Name As String, ByVal ID As String)
strName = Name
strID = ID
End Sub

Public Property Name() As String
Get
Return strName
End Get

Set(ByVal sValue As String)
strName = sValue
End Set
End Property

Public Property ItemData() As String
Get
Return strID
End Get

Set(ByVal iValue As String)
strID = iValue
End Set
End Property

Public Overrides Function ToString() As String
Return strName
End Function
End Class
- End Code -----------------------------------------------------
Here's the requeststring generated for the multipart form:

- Start requeststring ------------------------------------------
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="condition "

830
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="notes"

good good
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="image_fil e"; filename=""
Content-Type: application/octet-stream
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="image_url "
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="version"

729
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="domain_id "

1856
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="meta_id"

1
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="context_n ame"

w13.1097912464. 0000318444
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="x"

20
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="y"

20
-----------------------------7d4285126106b0--
- End requeststring --------------------------------------------

The requeststring looks right to me. I'm wondering if there's a
header I should set that I'm missing.

Thanks for the help.


--
Greg
----
greg -at- spencersoft -dot- com
Nov 21 '05 #4
That got right down to the details, didn't it?

I take it that, even though this thread is not new, you have not solved the
problem yet.

You look like you are doing things fairly well. You are collecting the
cookies and passing them back, and the formatting looks pretty good. I
would suggest, however, that the page that fails is calling a JSP, which
means that the server side may have a good deal of logic to PREVENT folks
like you from pretending to be a browser.

I don't see that you have set the User Agent header. It is probably normal
for the JSP page to be attempting to identify the browser, perhaps to send
back a message that will render correctly every time. I've done similar
code (a little differently, but same concept) and I've had problems when I
didn't set the User Agent header. That's where I would start.

If that doesn't work, there may be some software that you can install that
will sniff your own port 80, showing you what packets are travelling. You
can then access the pages using IE and then using your app, to see if there
is another header, perhaps one added by some Javascript code that downloaded
on the previous page, that you are not sending. I know that there is a tool
for doing this that is downloadable open source using the Unix compatibility
libraries (I used it about 18 months ago... don't remember the name but I'm
sure I can find it, so if you can't, let me know and I will dig a little).

Good luck
--- Nick Malik
http://weblogs.asp.net/nickmalik

"Gregory A Greenman" <se*@sig.belo w> wrote in message
news:MP******** *************** *@netnews.comca st.net...
In article <uD************ **@tk2msftngp13 .phx.gbl>,
jo*********@gmx .net says...
Gregory A Greenman wrote:
I'm trying to write a program in vb.net to automate filling out a
series of forms on a website. There are three forms I need to
fill out in sequence. The first one is urlencoded. My program is
able to fill that one out just fine.

The second form is multipart/form-data. Unfortunately, I haven't
been able to fill that out in a way that makes the server happy.

I set up a copy of this form at my web site so that I could see
exactly what a browser sends to the server and compare that to
what my program sends. I saw a few mistakes in my program and I
fixed them, but the real web site still rejects my program's
submissions.

As best I can tell, the contents that my program submits are
identical to the contents submitted by a browser. Is there
anything else that might be causing my problem?


Well, analyzing your problem from 10000' isn't that easy... can you provide more details (code, error messages, ...)?


Okay. I'm getting "The remote server returned an error: (500)
internal server error".

I've got a form with two text boxes in the upper left corner,
txtHalfID and txtHalfPassword . There are three text boxes in the
upper right corner, txtISBN, txtDescription and txtPrice. There's
also a drop down combo in the upper right, cmbCondition.

The bottom portion of the screen has a read only multi line text
box called txtResponse, where the raw HTML from the server is
displayed.

Below the left text boxes is a button, btnSignOn. If you click
that button, it will sign you onto Half.com using the ID and
password in the textboxes above it. This part works fine for me.
I can see the "Welcome to eBay" page in txtResponse.

Below the right boxes is a button called btnListBook. When I
click on it it should call four web pages on half.com in order.

First it calls http://half.ebay.com/help/sell_books.cfm. It fills
in the field in the form there with txtISBN.

Next it calls http://half.ebay.com/cat/sell/pmsearch.cgi. It
fills out the form there with txtDescription and cmbCondition.
This form allows file uploads, so it's a multipart form. Although
my program's output looks good to me, I get that server error
when I submit this form.

Here's the code:

- Start Code ---------------------------------------------------
Imports System.Net

Public Class SBM
Inherits System.Windows. Forms.Form

Dim cc As New CookieCollectio n
Const encURL As Integer = 0
Const encMulti As Integer = 1

Private Sub SBM_Load(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles MyBase.Load
txtHalfID.Text = ""
txtHalfPassword .Text = ""

txtISBN.Text = "0764560255 "
txtDescription. Text = "good good"
txtPrice.Text = "99.99"

With cmbCondition
.Items.Add(New Conditions("Bra nd New", "830"))
.Items.Add(New Conditions("Lik e New", "840"))
.Items.Add(New Conditions("Ver y Good", "849"))
.Items.Add(New Conditions("Goo d", "859"))
.Items.Add(New Conditions("Acc eptable", "864"))
.SelectedIndex = 0
End With

cmbCondition.Se lectedIndex = 0
End Sub

Private Sub btnSignOn_Click (ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles btnSignOn.Click
Dim HWRequest As HttpWebRequest
Dim strURL As String
Dim HWParameters As Parameters
Dim intFound As Integer

HWRequest = GetRequest
("https://signin.ebay.com/ws/eBayISAPI.dll?S ignIn&UsingSSL= 1
&co_partnerid=2 &siteid=20")
strURL = "https://signin.half.eba y.com/ws/eBayISAPI.dll"

HWParameters = ReadResponse(HW Request, strURL)

intFound = 0

For Each p As Parameter In HWParameters
Select Case p.Name
Case "userid"
p.Value = txtHalfID.Text
intFound += 1
Case "pass"
p.Value = txtHalfPassword .Text
intFound += 1
End Select

If intFound = 2 Then
Exit For
End If
Next

HWRequest = PostRequest(str URL, HWParameters, encURL)
GetResponse(HWR equest)
End Sub

Private Sub btnListBook_Cli ck(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles btnListBook.Cli ck
Dim strPostData As String
Dim HWRequest As HttpWebRequest
Dim strURL As String
Dim HWParameters As Parameters
Dim intFound As Integer
Dim pr As Parameter

Try
HWRequest = GetRequest
("http://half.ebay.com/help/sell_books.cfm" )
strURL = "http://half.ebay.com/cat/sell/pmsearch.cgi"

HWParameters = ReadResponse(HW Request, strURL)

intFound = 0

For Each p As Parameter In HWParameters
Select Case p.Name
Case "p_code"
p.Value = txtISBN.Text
intFound += 1
End Select

If intFound = 1 Then
Exit For
End If
Next

HWRequest = PostRequest(str URL, HWParameters, encURL)

strURL = "/cat/sell/save_new_listin g.cgi"

HWParameters = ReadResponse(HW Request, strURL)
pr = New Parameter
pr.Name = "x"
pr.Value = 20
pr.Type = Parameter.Input
HWParameters.Ad d(pr)
pr = New Parameter
pr.Name = "y"
pr.Value = 20
pr.Type = Parameter.Input
HWParameters.Ad d(pr)
intFound = 0

For Each p As Parameter In HWParameters
Select Case p.Name
Case "notes"
p.Value = txtDescription. Text
intFound += 1
Case "condition"
p.Value = cmbCondition.It ems
(cmbCondition.S electedIndex).I temData
intFound += 1
End Select

If intFound = 2 Then
Exit For
End If
Next

strURL =
"http://half.ebay.com/cat/sell/save_new_listin g.cgi"

HWRequest = PostRequest(str URL, HWParameters,
encMulti)

strURL = "sell.jsp"
HWRequest.Refer er =
"http://half.ebay.com/cat/sell/pmsearch.cgi"
'the internal server error is generated in this call
'to ReadResponse
HWParameters = ReadResponse(HW Request, strURL)
intFound = 0

For Each p As Parameter In HWParameters
Select Case p.Name
Case "itemPrice"
p.Value = txtPrice.Text
intFound += 1
End Select

If intFound = 1 Then
Exit For
End If
Next

strURL = "http://half.ebay.com/cat/sell/sell.jsp"

HWRequest = PostRequest(str URL, HWParameters, encURL)

GetResponse(HWR equest)

MessageBox.Show ("Success!", MsgBoxStyle.OKO nly, "Book
Posted")

Catch ex As Exception
MessageBox.Show ("Error: " & ex.Message, "Error!!!",
MessageBoxButto ns.OK, MessageBoxIcon. Exclamation)

MsgBox("Half.co m appears to have changed its posting
procedures. As a result, this version of SBM cannot list books on
it.", MsgBoxStyle.Exc lamation, "Half.com Listing Problem")
End Try
End Sub

Private Function GetRequest(ByVa l strURL As String) As
HttpWebRequest
GetRequest = CreateRequest(s trURL)
GetRequest.Meth od = "GET"
End Function

Private Function PostRequest(ByV al strURL As String, ByVal
PostParameters As Parameters, ByVal intType As Integer) As
HttpWebRequest
Dim encoding As New System.Text.ASC IIEncoding
Dim byte1 As Byte()
Dim newStream As System.IO.Strea m
Dim strData As String
Const strBoundary As String =
"---------------------------7d4285126106b0"

PostRequest = CreateRequest(s trURL)
PostRequest.Met hod = "POST"

If intType = encURL Then
PostRequest.Con tentType = "applicatio n/x-www-form-
urlencoded"
Else
PostRequest.Con tentType = "multipart/form-data,
boundary=" & strBoundary
End If

strData = BuildRequestStr ing(PostParamet ers, intType,
strBoundary)

PostRequest.Con tentLength = strData.Length

byte1 = encoding.GetByt es(strData)

newStream = PostRequest.Get RequestStream
newStream.Write (byte1, 0, byte1.Length)
newStream.Close ()
End Function

Private Function BuildRequestStr ing(ByVal RequestParamete rs
As Parameters, ByVal intType As Integer, ByVal strBoundary As
String)
BuildRequestStr ing = ""

Select Case intType
Case encURL
For Each p As Parameter In RequestParamete rs
BuildRequestStr ing &= p.Name.Trim & "=" &
p.Value.Trim & "&"
Next

BuildRequestStr ing = Mid(BuildReques tString, 1,
Len(BuildReques tString) - 1)
Case encMulti
'the requeststring generated for the multipart form is
'shown below
For Each p As Parameter In RequestParamete rs
BuildRequestStr ing &= "--" & strBoundary &
vbCrLf & "Content-Disposition: form-data; name=""" & p.Name.Trim
& """"
Select Case p.Type
Case Parameter.File
BuildRequestStr ing &= ";
filename=""""" & vbCrLf & "Content-Type: application/octet-
stream" & vbCrLf & vbCrLf & vbCrLf
Case Parameter.Input
BuildRequestStr ing &= vbCrLf & vbCrLf
& p.Value & vbCrLf
End Select
Next
BuildRequestStr ing &= "--" & strBoundary & "--"
End Select
End Function

Private Function CreateRequest(B yVal strURL As String) As
HttpWebRequest
Dim Uri As Uri

Uri = New Uri(strURL)
CreateRequest = HttpWebRequest. Create(Uri)
CreateRequest.A llowAutoRedirec t = True
CreateRequest.C ookieContainer = New CookieContainer

If cc.Count > 0 Then
CreateRequest.C ookieContainer. Add(cc)
End If
End Function

Private Sub GetResponse(ByV al ReadRequest As HttpWebRequest)
Dim HWResponse As HttpWebResponse
Dim cookie As Cookie

HWResponse = ReadRequest.Get Response()

If HWResponse.Cook ies.Count > 0 Then
For Each cookie In HWResponse.Cook ies
cc.Add(cookie)
Next
End If

'debugging
Dim sr As System.IO.Strea mReader
Dim strResult As String

sr = New System.IO.Strea mReader
(HWResponse.Get ResponseStream( ))

txtResponse.Tex t = sr.ReadToEnd

sr.Close()
'debugging
End Sub

Private Function ReadResponse(By Val ReadRequest As
HttpWebRequest, ByVal ReadURL As String) As Parameters
Dim HWResponse As HttpWebResponse
Dim cookie As Cookie
Dim sr As System.IO.Strea mReader
Dim strResult As String
Dim intTagPos As Integer
Dim intLength As Integer
Dim intURLPos As Integer
Dim strTag As String
Dim blnFormFound As Boolean
Dim blnMoreForms As Boolean
Dim intPos As Integer
Dim strName As String
Dim strValue As String
Dim ReadParameter As Parameter
Dim intType As Integer
Dim intInputPos As Integer
Dim intTextPos As Integer
Dim intSelectPos As Integer
Dim blnTagFound As Boolean

ReadResponse = New Parameters
'the next line generates the internal server error
HWResponse = ReadRequest.Get Response()

If HWResponse.Cook ies.Count > 0 Then
For Each cookie In HWResponse.Cook ies
cc.Add(cookie)
Next
End If

sr = New System.IO.Strea mReader
(HWResponse.Get ResponseStream( ))

strResult = sr.ReadToEnd

'debugging
txtResponse.Tex t = strResult
'debugging

blnFormFound = False
blnMoreForms = True
intTagPos = 1

While Not blnFormFound And blnMoreForms
intTagPos = InStr(intTagPos , strResult.ToUpp er,
"<FORM", CompareMethod.T ext)

If intTagPos <> 0 Then
intLength = InStr(intTagPos , strResult, ">",
CompareMethod.T ext) - intTagPos
strTag = strResult.Subst ring(intTagPos,
intLength)

intURLPos = InStr(1, strTag.ToUpper,
ReadURL.ToUpper , CompareMethod.T ext)

If intURLPos <> 0 Then
intLength = InStr(intTagPos ,
strResult.ToUpp er, "</FORM>", CompareMethod.T ext) - intTagPos
strResult = strResult.Subst ring(intTagPos,
intLength)
blnFormFound = True
Else
intTagPos += 1
End If
Else
blnMoreForms = False
End If
End While

If blnFormFound Then
intTagPos = 1

While intTagPos <> 0
intInputPos = InStr(intTagPos , strResult.ToUpp er,
"<INPUT", CompareMethod.T ext)
intTextPos = InStr(intTagPos , strResult.ToUpp er,
"<TEXTAREA" , CompareMethod.T ext)
intSelectPos = InStr(intTagPos ,
strResult.ToUpp er, "<SELECT", CompareMethod.T ext)

intTagPos = IIf(intTextPos <> 0 And intTextPos <
intInputPos, intTextPos, intInputPos)
intTagPos = IIf(intSelectPo s <> 0 And
intSelectPos < intTagPos, intSelectPos, intTagPos)

intType = Parameter.Input

If intTagPos <> 0 Then
intLength = InStr(intTagPos , strResult, ">",
CompareMethod.T ext) - intTagPos
strTag = strResult.Subst ring(intTagPos,
intLength)

intPos = InStr(1, strTag.ToUpper,
"TYPE=SUBMI T", CompareMethod.T ext)
If intPos = 0 Then
intPos = InStr(1, strTag.ToUpper,
"TYPE=""SUBMIT" "", CompareMethod.T ext)
End If

If intPos = 0 Then
intPos = InStr(1, strTag.ToUpper,
"NAME=""", CompareMethod.T ext)

If intPos = 0 Then
intPos = InStr(1, strTag.ToUpper,
"NAME=", CompareMethod.T ext)
intLength = InStr(intPos + 5, strTag,
" ", CompareMethod.T ext) - intPos - 5
strName = strTag.Substrin g(intPos +
4, intLength)
Else
intLength = InStr(intPos + 6, strTag,
"""", CompareMethod.T ext) - intPos - 6
strName = strTag.Substrin g(intPos +
5, intLength)
End If

If intPos <> 0 Then
intPos = InStr(1, strTag.ToUpper,
"VALUE=""", CompareMethod.T ext)

If intPos = 0 Then
strValue = ""
Else
intLength = InStr(intPos + 7,
strTag, """", CompareMethod.T ext) - intPos - 7
strValue = strTag.Substrin g
(intPos + 6, intLength)
End If

intPos = InStr(1, strTag.ToUpper,
"TYPE=""FILE""" , CompareMethod.T ext)

If intPos = 0 Then
intPos = InStr(1, strTag.ToUpper,
"TYPE=FILE" , CompareMethod.T ext)
End If

intType = IIf(intPos = 0, intType,
Parameter.File)

ReadParameter = New Parameter
ReadParameter.N ame = strName
ReadParameter.V alue = strValue
ReadParameter.T ype = intType
ReadResponse.Ad d(ReadParameter )
End If
End If

intTagPos += 1
End If
End While
Else
Throw New System.Exceptio n("Form not found.")
End If
End Function
End Class

Public Class Parameters
Inherits System.Collecti ons.CollectionB ase

Public Sub Add(ByVal sFld As Parameter)
List.Add(sFld)
End Sub

Public ReadOnly Property Item(ByVal index As Integer) As
Parameter
Get
Return CType(List.Item (index), Parameter)
End Get
End Property
End Class


Public Class Parameter
Public Const Input As Integer = 0
Public Const File As Integer = 1

Dim strName As String
Dim strValue As String
Dim intType As Integer

Public Property Name() As String
Get
Return strName
End Get
Set(ByVal vName As String)
strName = vName
End Set
End Property

Public Property Value() As String
Get
Return strValue
End Get
Set(ByVal vName As String)
strValue = vName
End Set
End Property

Public Property Type() As Integer
Get
Return intType
End Get
Set(ByVal vType As Integer)
intType = vType
End Set
End Property
End Class
Public Class Conditions
Private strName As String
Private strID As String

Public Sub New()
strName = ""
strID = ""
End Sub

Public Sub New(ByVal Name As String, ByVal ID As String)
strName = Name
strID = ID
End Sub

Public Property Name() As String
Get
Return strName
End Get

Set(ByVal sValue As String)
strName = sValue
End Set
End Property

Public Property ItemData() As String
Get
Return strID
End Get

Set(ByVal iValue As String)
strID = iValue
End Set
End Property

Public Overrides Function ToString() As String
Return strName
End Function
End Class
- End Code -----------------------------------------------------
Here's the requeststring generated for the multipart form:

- Start requeststring ------------------------------------------
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="condition "

830
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="notes"

good good
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="image_fil e"; filename=""
Content-Type: application/octet-stream
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="image_url "
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="version"

729
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="domain_id "

1856
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="meta_id"

1
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="context_n ame"

w13.1097912464. 0000318444
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="x"

20
-----------------------------7d4285126106b0
Content-Disposition: form-data; name="y"

20
-----------------------------7d4285126106b0--
- End requeststring --------------------------------------------

The requeststring looks right to me. I'm wondering if there's a
header I should set that I'm missing.

Thanks for the help.


--
Greg
----
greg -at- spencersoft -dot- com

Nov 21 '05 #5
In article <HAdcd.482227$8 _6.62731@attbi_ s04>,
ni*******@hotma il.nospam.com says...
That got right down to the details, didn't it?

I take it that, even though this thread is not new, you have not solved the
problem yet.

Nope, I had an important meeting out of town I had to prepare
for, plus I wanted to make my code more presentable before I
posted it.

You look like you are doing things fairly well. You are collecting the
cookies and passing them back, and the formatting looks pretty good. I
would suggest, however, that the page that fails is calling a JSP, which
means that the server side may have a good deal of logic to PREVENT folks
like you from pretending to be a browser.

Here's the form tag for the three pages I'm trying to access. The
problem I was having was with the second form. It looks like the
third one uses Java, so that may be a problem there.

<FORM action="http://half.ebay.com/cat/sell/pmsearch.cgi"
method="post">

<form action="/cat/sell/save_new_listin g.cgi"
enctype="multip art/form-data" method=post>

<form name="pricing" method="post" action="sell.js p" onSubmit="if
(this.submitted ) return false; else { this.submitted = true;
disableSubmits( this); return true; }">

I don't see that you have set the User Agent header. It is probably normal
for the JSP page to be attempting to identify the browser, perhaps to send
back a message that will render correctly every time. I've done similar
code (a little differently, but same concept) and I've had problems when I
didn't set the User Agent header. That's where I would start.

That seems to have solved the problem, at least for this step. I
added this line:

HWRequest.UserA gent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows
NT 5.1; SV1; .NET CLR 1.1.4322)"

and I was able to get past the problem. I did get a 404 error, so
I'm not all the way home yet, but I'm one step closer. Also, the
404 error came later than the 505 I was getting previously.

I'm about to head out the door, so I'll see if I can make any
more progress later tonight.

If that doesn't work, there may be some software that you can install that
will sniff your own port 80, showing you what packets are travelling. You
can then access the pages using IE and then using your app, to see if there
is another header, perhaps one added by some Javascript code that downloaded
on the previous page, that you are not sending. I know that there is a tool
for doing this that is downloadable open source using the Unix compatibility
libraries (I used it about 18 months ago... don't remember the name but I'm
sure I can find it, so if you can't, let me know and I will dig a little).

I found this: tcptrace http://www.tcptrace.com/. Hopefully I'll
be able to cross this next hurdle without it.

Thanks for the help,
Greg
Nov 21 '05 #6
Gregory A Greenman wrote:
In article <HAdcd.482227$8 _6.62731@attbi_ s04>,
ni*******@hotma il.nospam.com says...


I think the way you handle upload files may be the culprit. You're uploading
files (or rather pretend to) exclusively as application/octet-stream. From a
web application perspective, application/octet-stream is rather
unspecific -- I cannot imagine what a web application could do with some
unspecific binary content (other than archive it in some way).

As far useful tools are concerned, I strongly suggest using Fiddler
(http://www.fiddlertool.com/). It's a debugging proxy that runs locally and
can track all HTTP traffic between your application and the remote host.

Cheers,

--
Joerg Jooss
www.joergjooss.de
ne**@joergjooss .de
Nov 21 '05 #7
In article <u$************ **@TK2MSFTNGP09 .phx.gbl>,
jo*********@gmx .net says...
Gregory A Greenman wrote:
In article <HAdcd.482227$8 _6.62731@attbi_ s04>,
ni*******@hotma il.nospam.com says...
I think the way you handle upload files may be the culprit. You're uploading
files (or rather pretend to) exclusively as application/octet-stream. From a
web application perspective, application/octet-stream is rather
unspecific -- I cannot imagine what a web application could do with some
unspecific binary content (other than archive it in some way).


I had set up a mock version of that form on my web site. When the
button was clicked on that form, the cgi would just record what
the browser sent. I copied that into my program. Both IE and
Mozilla Firefox used application/octet-stream when there was no
actual upload.

I was finally able to get past that page by adding the following
line to my code:

HWRequest.UserA gent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows
NT 5.1; SV1; .NET CLR 1.1.4322)"

Stripping it of all extraneous HTML, the form that I was trying
to fill out is:

<form action="/cat/sell/save_new_listin g.cgi"
enctype="multip art/form-data" method=post>
<select name=condition SELECTED>
<option value=''>Select One
<option value=830 >Brand New
<option value=840 >Like New
<option value=849 >Very Good
<option value=859 >Good
<option value=864 >Acceptable
</select>
<textarea name="notes" rows=5 cols=40></textarea>
<INPUT TYPE=FILE NAME="image_fil e">
<INPUT TYPE=TEXT NAME="image_url " VALUE=>
<input type=submit name="Continue" value="Continue &gt;" border=
0>
<input type=hidden name="version" value="729">
<input type=hidden name="domain_id " value="1856">
<input type=hidden name="meta_id" value="1">
<input type=hidden name="context_n ame"
value="w48.1097 876311.00002236 4">
</form>

I noticed that when IE filled out the form, it put the "x" and
"y" parameters at the end, after all the hidden parameters. OTOH,
Mozilla Firefox placed "x" and "y" where the button is, before
the hidden parameters. Maybe that's why that page needs to know
what the browser is when the others didn't.

As far useful tools are concerned, I strongly suggest using Fiddler
(http://www.fiddlertool.com/). It's a debugging proxy that runs locally and
can track all HTTP traffic between your application and the remote host.

Thanks, I'm now having a problem filling out the next (and last)
form in the sequence. I may take a look at that, if I can't
figure out the solution otherwise.

Thanks for the help.
--
Greg
----
greg -at- spencersoft -dot- com
Nov 21 '05 #8
Gregory A Greenman wrote:
I had set up a mock version of that form on my web site. When the
button was clicked on that form, the cgi would just record what
the browser sent. I copied that into my program. Both IE and
Mozilla Firefox used application/octet-stream when there was no
actual upload.
That's because you probably tried to upload some arbitrary binary. Both
browsers use proper the MIME type for file uploads if possible.
I noticed that when IE filled out the form, it put the "x" and
"y" parameters at the end, after all the hidden parameters. OTOH,
Mozilla Firefox placed "x" and "y" where the button is, before
the hidden parameters. Maybe that's why that page needs to know
what the browser is when the others didn't.


There's no defined order in which form parameters are to be sent, so that
shouldn't make a difference. If a web application does assume a specific
order, it's broken.

Cheers,

--
Joerg Jooss
www.joergjooss.de
ne**@joergjooss .de
Nov 21 '05 #9
In article <#X************ **@tk2msftngp13 .phx.gbl>,
jo*********@gmx .net says...
Gregory A Greenman wrote:
I had set up a mock version of that form on my web site. When the
button was clicked on that form, the cgi would just record what
the browser sent. I copied that into my program. Both IE and
Mozilla Firefox used application/octet-stream when there was no
actual upload.


That's because you probably tried to upload some arbitrary binary. Both
browsers use proper the MIME type for file uploads if possible.

No, I've never tried to do an upload with this form. Apparently,
if there's no upload, IE and FF both use application/octet-stream
with no data.

I noticed that when IE filled out the form, it put the "x" and
"y" parameters at the end, after all the hidden parameters. OTOH,
Mozilla Firefox placed "x" and "y" where the button is, before
the hidden parameters. Maybe that's why that page needs to know
what the browser is when the others didn't.


There's no defined order in which form parameters are to be sent, so that
shouldn't make a difference. If a web application does assume a specific
order, it's broken.

I can't seem to find any equivalent for multipart forms, but
according to RFC 1866 browsers should list the parameters in the
same order they appear in in the form.

8.2.1.2:
"The fields are listed in the order they appear in the document
with the name separated from the value by `=' and the pairs
separated from each other by `&'. Fields with null values may be
omitted."

http://www.faqs.org/rfcs/rfc1866.html

In an early pass, I wasn't preserving the field order. For the
multipart form, half was complaining that I hadn't sent it the
condition parameter. So, I think the order matters for this.

Thanks for the help.
--
Greg
----
greg -at- spencersoft -dot- com
Nov 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4104
by: Jerry Rhodes | last post by:
When I run the code below, the web server tells me that I need to enable cookies. Can anyone tell me what might be causing that? I'm trying to POST userid and password to their login web page. Thanks! Dim CookieJar As CookieContainer = New CookieContainer() Dim WebReq As HttpWebRequest Dim WebResp As HttpWebResponse Dim StrmRdr As StreamReader Dim StrmWrtr As StreamWriter Dim PostParms As String
14
12123
by: John A Grandy | last post by:
has anyone successfully used HttpWebRequest or WebClient class to simulate submission of a simple HTML form? for example: a very simple plain-vanilla form with a textbox and a button. when the button is clicked the form is submitted with the textbox contents. could you please post some sample code? thanks.
8
5370
by: Pazza | last post by:
Hi, Is there a way to cause the form submit button click event handler to fire when posting to a aspx page using httpwebrequest. In my tests the load event fires but not by button click event. I am hoping to use this technique for a screen scraper but if I can't get the submit buttons click event handler to fire its no use. Thanks,
7
4251
by: | last post by:
Hello, I would like to do the following from a asp.net button click: <form method="POST" action="https://www.1234.com/trans_center/gateway/direct.cgi"> <input type="hidden" name="Merchant" value="Merchant Name"> <input type="hidden" name="OrderID" value="Unique OrderID value"> <input type="hidden" name="email" value="Customers email address (OPTIONAL)">
3
5247
by: tscamurra | last post by:
Hello, I have a web app that performs screen scaping and submits a form. My code worked until the page was changed to use .aspx code. I am updating my code to conform to the new pages but am having difficulty submitting the page. I use the WebCLient Class and create a collection of form values, however there is not 'submit' button. There is an anchor tag that has an href that calls the familiar __DoPostBack function.
4
12698
by: Natalia | last post by:
Hello, I need to provide the ability to post file and some form elements via our website (asp.net) to the third party website (asp page). On http://aspalliance.com/236#Page4 - I found great advices but still having troubles... it might some obvious error that I am making but I just dont see it. ==================FIRST - Webclient=================================
0
1094
by: Terry Olsen | last post by:
Given the following FORM definition contained in the default.asp html: <form method="post" name="theform" action="validate.asp"> <input type="text" name="loginid"> <input type="password" name="pass"> <input type="submit" value="Login"> </form> How can I log into this web page? The code below just takes me back to the default.asp page. Is there anything I'm missing?
4
5316
by: yoram.ayalon | last post by:
Hi, I need to create a multipart request to UPS manifest upload electronic service. UPS wants the request to consist of a series of headers and bodies, and its not clear how can I use the HttpWebRequest object to do this. there is the Headers collection, but I don't think it will give me the control we need. is there a low-level way to create the entire stream and attach to the object before posting ?
1
1950
by: csgraham74 | last post by:
Just a quick one - im trying to post values to a page using a method below. im coding in asp.net vb. i was wondering how i also redirect to the page as well as post the values at the same time. e.g. in html it would be something like <form action=https://www.text.cgi method=post> <input type=visible name="val1" value="<%=val1%>"> <input type=visible name="val2" value="<%=val2%>"> <input type=submit value="Proceed to server" id="Submit1"...
1
4451
yawar
by: yawar | last post by:
Hi, I am a newbie in System.Net programming though I have worked on mshtml but I want to do things more perfectly and with speed. I have created one software that login to gmail using httpwebrequest and check that email ID is active or deleted. But, that was I think simple login process. For that I had first tried with Wireshark but may be its too complicated or I am new to wireshark, anyways I was not able to find out that where is...
0
8256
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8189
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8694
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8356
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8497
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6118
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
1803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1500
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.