473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

WebClient.UploadValues doesn't work on Vista only

I have a program that uses WebClient.UploadValues method to send login
information to a web site. It works fine on Windows XP, but on Windows
Vista the users seems to be sent wrong, because the login data is not
accepted.

Do you know if there is any incompatibility between WebClient class
and Windows Vista?

My code is like this:

NameValueCollection nvc = new NameValueCollection();

nvc.Add("UsernameControl_ID", this.User);
nvc.Add("PasswordControl_ID", this.Password);
statusMessage =
Utils.GetLocalizedString("message.status.logging_o ut");
StatusMessageChanged();

//Forcing logout
webClient.DownloadFile(Urls.Logout, Utils.HtmlTempFile);

try
{
statusMessage =
Utils.GetLocalizedString("message.status.logging_i n");
StatusMessageChanged();

byte[] response = webClient.UploadValues(Urls.Logon, nvc);

SaveToTempHtmlFile(Encoding.ASCII.GetString(respon se));

statusMessage =
Utils.GetLocalizedString("message.status.loading_p age");
StatusMessageChanged();

return UserLoggedOn();
}
catch
{
}

Sep 27 '07 #1
0 1025

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

Similar topics

0
by: ryanbaldwin | last post by:
Hi, I'm writing a simple little application that posts to a Uri using the System.Net.WebClient class. In my application I wish to throw an Exception if anything other than a 200 OK is returned. ...
2
by: Max Gattringer | last post by:
Hi, I've got a little problem with the WebClient, I always get a failure while debugging this code: private void menuItem2_Click(object sender, System.EventArgs e) { NameValueCollection...
1
by: Adnan Selimovic | last post by:
Hi folks! I tried to post a web form using the WebClient class and HttpWebRequest/HttpWebResponse. It didn't work for the ASPX web pages. I always got an unposted version - like if I had just made...
0
by: Kumar | last post by:
Hi all, I have the following code which uses WebClient.UploadValues myNameValueCollection.Add("Name", name) myNameValueCollection.Add("Age", age) .............. ............. Dim web As New...
3
by: Manuel | last post by:
I have an asp page ("test.asp") that presents the data it receives from a post.When I try the following code, test.asp doesn't return the values (supposedly) posted to it. If I make a web page with...
0
by: DrBytes | last post by:
Hi, .. I'm trying to post some values to an aspx but seem to be unable to get the formdata there . This is what I do: NameValueCollection form = new NameValueCollection(); form.Add("foo",...
0
by: parez | last post by:
Hi all! The webclient class's uploadvalues method appends %0d%0a to the last value in the name value collection.. Can any one help me out.. Thanks in advance.. Here is code...
3
by: Giggi | last post by:
Hi! I need to pass some strings via an HTTP POST from page1 (in my app) to a page on another server. I stored my data in a NameValueCollection and then sent it using WebClient.UploadValues....
1
by: jaffar.kazi | last post by:
Hi All, I have a .NET Winforms application that regularly posts to a PHP page. Till a few days back this worked perfectly. However, now, on certain machines, after the data is sent to the server,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...

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.