I'm a sysadmin trying to write a utility to automatically download and install the appropriate and current drivers from the Dell website.
I'm just getting started and at the moment I'm working on trying to figure out how to submit the correct URI to their site. I've identified the parameters, but I just can't seem to get them to take.
For instance, the generated URI takes me to the correct page if I use a browser or wget, but all the code seems to get is the "duhwhat" page.
Here's my code, I didn't include the EasyHTTP class as it's unmodified from the original. Can anybody save me a few gray hairs and tell me what's going wrong?
BTW, this is try #2, I noodled with manually doing the webrequest then found EasyHTTP, hoping it would be...easy.
Thanks for looking!
edit: Upon closer examination with a protocol analyzer, it's actually GETting.
I'm just getting started and at the moment I'm working on trying to figure out how to submit the correct URI to their site. I've identified the parameters, but I just can't seem to get them to take.
For instance, the generated URI takes me to the correct page if I use a browser or wget, but all the code seems to get is the "duhwhat" page.
Here's my code, I didn't include the EasyHTTP class as it's unmodified from the original. Can anybody save me a few gray hairs and tell me what's going wrong?
BTW, this is try #2, I noodled with manually doing the webrequest then found EasyHTTP, hoping it would be...easy.
Thanks for looking!
VB.NET:
Imports System
Imports System.IO
Imports System.Net
Imports System.Text
Public Class Form1
Dim urlstring As String = "http://support.dell.com/support/downloads/driverslist.aspx"
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles Button1.Click
'catid is the type of driver (3 is audio) and OS is the OS (not sure why
'XP gets "WW1"). These will be determined by radio buttons at runtime.
'Only three of these are necessary to input into a browser: servicetag,
'os, and catid.
Dim catid As String = "3"
Dim os As String = "WW1"
Dim postData As String = "servicetag" + ChrW(61) + TextBox1.Text
postData = postData + ChrW(38) + "os" + ChrW(61) + os
postData = postData + ChrW(38) + "osl" + ChrW(61) + "en"
postData = postData + ChrW(38) + "catid" + ChrW(61) + catid
postData = postData + ChrW(38) + "c" + ChrW(61) + "us"
'This changes for every device and doesn't seem to be necessary.
' postData = postData + ChrW(38) + "cs" + ChrW(61) + "us"
postData = postData + ChrW(38) + "l" + ChrW(61) + "en"
postData = postData + ChrW(38) + "s" + ChrW(61) + "pub"
'The data returned by this is the "WTF was that?" page.
RichTextBox1.Text = easyhttp.Send(urlstring, postData, _
easyhttp.HTTPMethod.HTTP_POST, "application/x-www-form-urlencoded")
'This works fine
System.Diagnostics.Process.Start(urlstring + "?" + postData)
End Sub
End Class
edit: Upon closer examination with a protocol analyzer, it's actually GETting.
Last edited: