Click here to Skip to main content
15,867,835 members
Home / Discussions / C#
   

C#

 
AnswerRe: List Pin
Steve Foutty25-Jul-14 3:12
Steve Foutty25-Jul-14 3:12 
GeneralRe: List Pin
PIEBALDconsult25-Jul-14 20:27
mvePIEBALDconsult25-Jul-14 20:27 
QuestionAsp.net rdcl Report Pin
Zeyad Jalil23-Jul-14 23:00
professionalZeyad Jalil23-Jul-14 23:00 
AnswerRe: Asp.net rdcl Report Pin
thatraja24-Jul-14 2:17
professionalthatraja24-Jul-14 2:17 
QuestionCrystal Report Sort by Date Formula Pin
Amr Muhammed23-Jul-14 13:28
Amr Muhammed23-Jul-14 13:28 
AnswerRe: Crystal Report Sort by Date Formula Pin
thatraja24-Jul-14 2:30
professionalthatraja24-Jul-14 2:30 
AnswerRe: Crystal Report Sort by Date Formula Pin
jschell24-Jul-14 11:39
jschell24-Jul-14 11:39 
QuestionUsing a proxy server in c# Pin
Member 1052179323-Jul-14 13:03
Member 1052179323-Jul-14 13:03 
Hey, I am trying to make an application that allows me to connect to a proxy server through a c# console application but I am not sure how.What I want to achieve is the program selects a random IP from the list in a text file and opens up google using the chosen proxy IP, I want to use it in school because the website restrictions are completely broken, most websites are blocked for either sales or occult. I've been looking around on the web and I found a few things like HttpWebRequest and HttpWebResponse but I don't know how to use it, could someone link me to a website that explains this kind of thing or explain it on here please.

I've got this but its probably completely wrong.
In ProxyIps.txt there is a large list of proxy IP addresses.

<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Text;<br />
using System.IO;<br />
using System.Net;<br />
<br />
namespace FirstWebProxy<br />
{<br />
    class Program<br />
    {<br />
        static void Main(string[] args)<br />
        {<br />
            Console.WriteLine("Available proxys:");<br />
<br />
            string[] lines = System.IO.File.ReadAllLines(@"C:\Users\user0\Documents\Visual Studio 2010\Projects\FirstWebProxy\ProxyIps.txt");<br />
<br />
            foreach (string line in lines)<br />
            {<br />
            <br />
                Console.WriteLine("\t" + line);<br />
            }<br />
<br />
            Console.WriteLine("Would you like to connect to a random server? Type Y or N");<br />
            string r = Console.ReadLine();<br />
<br />
            if (r =="Y" || r =="y") {<br />
                <pre lang="cs">var p = new Random();<br />
                var randomLineNumber = p.Next(0, lines.Length - 1);<br />
                var host = lines[randomLineNumber];<br />
<br />
                string url = "http://www.google.com/";<br />
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);<br />
                WebProxy myproxy = new WebProxy(host, false);<br />
                request.Proxy = myproxy;<br />
                request.Method = "GET";<br />
                HttpWebResponse response = (HttpWebResponse)request.GetResponse();<br />
            }<br />
<br />
        }<br />
    }<br />
}<br />
<br />


Thanks in advance.
AnswerRe: Using a proxy server in c# Pin
Bernhard Hiller23-Jul-14 20:23
Bernhard Hiller23-Jul-14 20:23 
GeneralRe: Using a proxy server in c# Pin
Member 1052179324-Jul-14 0:53
Member 1052179324-Jul-14 0:53 
GeneralRe: Using a proxy server in c# Pin
Bernhard Hiller24-Jul-14 2:58
Bernhard Hiller24-Jul-14 2:58 
QuestionKurti dev to uni code and uni code yo kurti dev convert by script Pin
Member 1096585923-Jul-14 1:36
Member 1096585923-Jul-14 1:36 
AnswerRe: Kurti dev to uni code and uni code yo kurti dev convert by script Pin
thatraja23-Jul-14 1:57
professionalthatraja23-Jul-14 1:57 
GeneralRe: Kurti dev to uni code and uni code yo kurti dev convert by script Pin
Member 1096585923-Jul-14 2:03
Member 1096585923-Jul-14 2:03 
GeneralRe: Kurti dev to uni code and uni code yo kurti dev convert by script Pin
thatraja23-Jul-14 21:07
professionalthatraja23-Jul-14 21:07 
QuestioniTextSharp PDF Overlay Pin
michPla1223-Jul-14 1:16
michPla1223-Jul-14 1:16 
Questionadd multiple passengers Pin
Jassim Rahma22-Jul-14 11:41
Jassim Rahma22-Jul-14 11:41 
GeneralRe: add multiple passengers Pin
PIEBALDconsult22-Jul-14 18:58
mvePIEBALDconsult22-Jul-14 18:58 
AnswerRe: add multiple passengers Pin
OriginalGriff22-Jul-14 19:47
mveOriginalGriff22-Jul-14 19:47 
QuestionHELP Pin
Member 1094467922-Jul-14 3:20
Member 1094467922-Jul-14 3:20 
AnswerRe: HELP Pin
Ravi Bhavnani22-Jul-14 3:57
professionalRavi Bhavnani22-Jul-14 3:57 
GeneralRe: HELP Pin
Member 1094467922-Jul-14 4:07
Member 1094467922-Jul-14 4:07 
GeneralRe: HELP Pin
Ravi Bhavnani22-Jul-14 4:16
professionalRavi Bhavnani22-Jul-14 4:16 
AnswerRe: HELP Pin
Ron Nicholson22-Jul-14 4:08
professionalRon Nicholson22-Jul-14 4:08 
GeneralRe: HELP Pin
Richard MacCutchan22-Jul-14 5:04
mveRichard MacCutchan22-Jul-14 5:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.