Click here to Skip to main content
15,888,733 members
Home / Discussions / C#
   

C#

 
QuestionHow to make a GUI in cosmos Pin
Member 121050098-Nov-15 9:29
Member 121050098-Nov-15 9:29 
AnswerRe: How to make a GUI in cosmos Pin
Richard Andrew x648-Nov-15 9:45
professionalRichard Andrew x648-Nov-15 9:45 
GeneralRe: How to make a GUI in cosmos Pin
BillWoodruff8-Nov-15 9:53
professionalBillWoodruff8-Nov-15 9:53 
GeneralRe: How to make a GUI in cosmos Pin
Richard Andrew x648-Nov-15 10:08
professionalRichard Andrew x648-Nov-15 10:08 
AnswerRe: How to make a GUI in cosmos Pin
Eddy Vluggen8-Nov-15 9:50
professionalEddy Vluggen8-Nov-15 9:50 
GeneralRe: How to make a GUI in cosmos Pin
BillWoodruff8-Nov-15 10:19
professionalBillWoodruff8-Nov-15 10:19 
GeneralRe: How to make a GUI in cosmos Pin
Eddy Vluggen9-Nov-15 1:14
professionalEddy Vluggen9-Nov-15 1:14 
QuestionC# Using Proxies with HttpWebRequests Pin
Member 113675538-Nov-15 3:36
Member 113675538-Nov-15 3:36 
so here I'm trying to use proxies from a listView in my project. But I have no clue and have had no experiences in using proxies in C# before nore in any other form of anything haha.

So what I've got so far is a button to import a .txt file of "proxies" and it adds the items to a listView.

From there I'm wanting a loop in my proxy state so it runs through the listView of proxies.

I have no clue on what I'm doing here so would need some extended support here. In need of this for a college project.

Here is my post data.

C#
    CookieContainer cookieCon = new CookieContainer();
public string postRequest(string url, String postData, String Username, String Password)
{
    try
    {
        HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
        request.Method = "POST";
        request.CookieContainer = cookieCon;
        request.ContentType = "application/json; charset=utf-8";
        request.Headers.Add("Cookie", "devicecookie=146.200.41.147.1446567416483.346;");
        request.UserAgent = "FireFox User Agent";
        request.Headers.Add("Accept-Language", "en-GB,en-US;q=0.8");
        request.Host = "www.collegename.co.uk";
        request.Headers.Add("Accept-Encoding", "gzip");
        request.KeepAlive = true;
        byte[] byteArr = Encoding.Default.GetBytes(postData);
        request.ContentLength = byteArr.Length;
        Stream dataStream = request.GetRequestStream();
        dataStream.Write(byteArr, 0, byteArr.Length);
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();
        StreamReader reader = new StreamReader(response.GetResponseStream());
        string source = reader.ReadToEnd();
        return source;

    }
    catch (Exception ex)
    {
        if (ex.Message.Contains("401"))
        {

        }
    }
    return null;
}


Would appreciate it if you could give me some help here, thanks guys. I'm not looking to change a mass amount of my code but would appreciate some help.
QuestionRe: C# Using Proxies with HttpWebRequests Pin
Richard MacCutchan8-Nov-15 3:43
mveRichard MacCutchan8-Nov-15 3:43 
AnswerRe: C# Using Proxies with HttpWebRequests Pin
Member 113675538-Nov-15 3:45
Member 113675538-Nov-15 3:45 
QuestionRe: C# Using Proxies with HttpWebRequests Pin
Richard MacCutchan8-Nov-15 4:00
mveRichard MacCutchan8-Nov-15 4:00 
AnswerRe: C# Using Proxies with HttpWebRequests Pin
Member 113675538-Nov-15 4:01
Member 113675538-Nov-15 4:01 
AnswerRe: C# Using Proxies with HttpWebRequests Pin
Eddy Vluggen8-Nov-15 4:06
professionalEddy Vluggen8-Nov-15 4:06 
GeneralRe: C# Using Proxies with HttpWebRequests Pin
Member 113675538-Nov-15 4:09
Member 113675538-Nov-15 4:09 
GeneralRe: C# Using Proxies with HttpWebRequests Pin
Eddy Vluggen8-Nov-15 4:22
professionalEddy Vluggen8-Nov-15 4:22 
GeneralRe: C# Using Proxies with HttpWebRequests Pin
Member 113675538-Nov-15 4:32
Member 113675538-Nov-15 4:32 
GeneralRe: C# Using Proxies with HttpWebRequests Pin
Eddy Vluggen8-Nov-15 4:53
professionalEddy Vluggen8-Nov-15 4:53 
GeneralRe: C# Using Proxies with HttpWebRequests Pin
John Torjo8-Nov-15 19:09
professionalJohn Torjo8-Nov-15 19:09 
Questionprevent method execution on design time using attributes Pin
Gilbert Consellado7-Nov-15 15:59
professionalGilbert Consellado7-Nov-15 15:59 
AnswerRe: prevent method execution on design time using attributes Pin
George Jonsson7-Nov-15 18:00
professionalGeorge Jonsson7-Nov-15 18:00 
AnswerRe: prevent method execution on design time using attributes Pin
Richard MacCutchan7-Nov-15 21:11
mveRichard MacCutchan7-Nov-15 21:11 
GeneralRe: prevent method execution on design time using attributes Pin
Gilbert Consellado8-Nov-15 1:33
professionalGilbert Consellado8-Nov-15 1:33 
AnswerRe: prevent method execution on design time using attributes Pin
OriginalGriff7-Nov-15 22:48
mveOriginalGriff7-Nov-15 22:48 
GeneralRe: prevent method execution on design time using attributes Pin
Gilbert Consellado8-Nov-15 1:35
professionalGilbert Consellado8-Nov-15 1:35 
GeneralRe: prevent method execution on design time using attributes Pin
OriginalGriff8-Nov-15 1:41
mveOriginalGriff8-Nov-15 1:41 

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.