I know that this concept is a relative target for hate, but I would like to seek help as my current code (Visual Studio C#) is connecting and yet can't seem to add views.
CODE:
using System;
using System.Net;
using System****; <-- Won't display . I O
using System.Threading;
using System.Collections.Generic;
namespace ConsoleApplication3
{
class Program
{
public static List<int> skip = new List<int>();
static void Main(string[] args)
{
while (true)
{
int counter = 1;
string line;
// Read the file and display it line by line.
String ip = "1";
int port;
System****.StreamReader file = new System****.StreamReader("c:\\users\\emmett\\deskto p\\proxies.txt");
while ((line = file.ReadLine()) != null)
{
String[] parts = line.Split(':');
int i = 1;
foreach(string s in parts)
{
if (i == 1)
{
ip = s;
i = 2;
}
else
{
port = Convert.ToInt32(s);
connect(ip, port, counter);
}
}
counter++;
}
}
}
static void connect(String ip, int port, int n)
{
try
{
if (!skip.Contains(n))
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("<<TWITCH PAGE>>");
request.Timeout = 2000;
WebProxy myproxy = new WebProxy(ip, port);
myproxy.BypassProxyOnLocal = false;
request.Proxy = myproxy;
request.Method = "POST";
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Console.WriteLine();
response.Close();
}
else
{
Console.WriteLine("BAD PROXY");
}
}
catch (ArgumentException e)
{
Console.WriteLine(n);
skip.Add(n);
}
catch (WebException e)
{
Console.WriteLine(n);
skip.Add(n);
}
catch (Exception e)
{
Console.WriteLine(n);
skip.Add(n);
}
Thread.Sleep(1);
}
}
}
I am currently able to connect but, once again, my view count is not changing and alone I fear that I have been unable to succeed. Any advice is much appreciated, thanks!
ON FILE FORMATTING --> You may have noticed a section of code which reads a file to gather a proxy ip and port and then sends the connect attempt using that information. The format for this, in the .txt file, is as follows:
IP:Port
IP:Port
REPEAT...
Essentially, this format is due to the proxy scraper I use. (gatherproxy.com) Please also note that the file reading is currently working fine. Only the system as a whole is failing.
