Webclient.Upload(string, string)

cduance

New member
Joined
Aug 22, 2010
Messages
1
Programming Experience
1-3
Hi,

I need a little explanation as to how this works because some of the code appears to be redundant in my case. My code is as follows

VB.NET:
Dim myWebNewServer As New WebClient
        Dim ServerData As String = ""
        Dim strNewServerURL As String = "http://URLHere/NewServer.aspx?ServerID=" + NewServerID + "&" + "OfficeID=" + Convert.ToString(ComboBox2.Items(ComboBox2.SelectedIndex).ItemData) + "&" + "ServerName=" + ServerName

        'ServerData = "ServerID=" + Convert.ToString(NewServerID) + "&" + "OfficeID=" + Convert.ToString(ComboBox2.Items(ComboBox2.SelectedIndex).ItemData) + "&" + "ServerName=" + ServerName

        myRetString = myWebNewServer.UploadString(strNewServerURL, ServerData)

I have had to add the values into the strNewServerURL URL because of this I have commented out the ServerData line as it doesnt use it. Have I dont something wrong here? I am trying to send a string to a webpage and then the webpage should take that string and read it in to a collection. THe collection then has the values extracted and passed to a SQL stored Procedure. WHat I wanted to happen is that the URL to the page only is contained in the ServerData string and this is then uploaded to the page without the need to specify all the values in the URL which I have currently had to do. Hope you understand.

Charles
 
Back
Top