TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ronney lovely
NA
1
0
Is WebProxy class only support HTTP proxy type?
Jun 8 2007 11:54 AM
Is there a way to use Socks4, Socks4a or Socks5 proxy types with WebProxy class. I have downloaded a Proxy Server "ccproxy" from http://www.youngzsoft.net/ccproxy/screenshot.htm where i can use my code to download and upload files but it works only with Port 808 reserved for HTTP proxy in ccproxy server. Http Get Code... WebClient client = new WebClient(); if (tbpassword.Text != "" && tbUsername.Text != "") { NetworkCredential auth = new NetworkCredential(tbUsername.Text, tbpassword.Text); client.Credentials = auth; } if (tbProxyAddress.Text != "" && tbProxyPort.Text != "") { WebProxy proxy = new WebProxy(tbProxyAddress.Text, Convert.ToInt32(tbProxyPort.Text)); if(tbProxyUsr.Text != "" && tbProxyPwd.Text != "") proxy.Credentials = new NetworkCredential(tbProxyUsr.Text, tbProxyPwd.Text); client.Proxy = proxy; } Uri uri = new Uri(tbURL.Text); client.DownloadFile(uri, tblocalFile.Text); client.Dispose(); HTTP Post Code... WebClient client = new WebClient(); if (tbpassword.Text != "" && tbUsername.Text != "") { NetworkCredential auth = new NetworkCredential(tbUsername.Text, tbpassword.Text); client.Credentials = auth; } if (tbProxyAddress.Text != "" && tbProxyPort.Text != "") { WebProxy proxy = new WebProxy(tbProxyAddress.Text, Convert.ToInt32(tbProxyPort.Text)); if (tbProxyUsr.Text != "" && tbProxyPwd.Text != "") proxy.Credentials = new NetworkCredential(tbProxyUsr.Text, tbProxyPwd.Text); client.Proxy = proxy; } Uri uri = new Uri(tbURL.Text); System.Collections.Specialized.NameValueCollection collect = new System.Collections.Specialized.NameValueCollection(); collect.Add("input", "Ronak"); collect.Add("submit", "Submit"); byte[] btArray = client.UploadValues(uri, "POST", collect); //byte[] btArray = client.UploadFile(uri, "POST", tblocalFile.Text); MessageBox.Show(Encoding.UTF8.GetString(btArray)); client.Dispose();
Reply
Answers (
1
)
How to translate text in another language
Timer control, how to use it for a countdown.