C
C#2y ago
baba

❔ exception for proxy help

hey guys, my c# knowledge isnt the best but i have a question plz im using this code:
private static async Task Check()
{
foreach (var cookieList in CookieList)
{
var user = JsonReader.readJSON("dataproxy.json", "proxyDetails", "proxyuser");
var pass = JsonReader.readJSON("dataproxy.json", "proxyDetails", "proxypass");
var proxyIp = JsonReader.readJSON("dataproxy.json", "proxyDetails", "proxyip");
var proxyPort = JsonReader.readJSON("dataproxy.json", "proxyDetails", "proxyport");
var container = new CookieContainer();
var handler = new HttpClientHandler();
handler.CookieContainer = container;
var client = new HttpClient(handler);
WebProxy proxy = new WebProxy(proxyIp,Convert.ToInt32(proxyPort));
if(user != null)
{
proxy.Credentials = new NetworkCredential(user, pass);
}
client.BaseAddress = BaseAddress; try
{
handler.Proxy = proxy;
}
catch
{
LogSystem.SendMessage("Proxy Error!", Log.Type.Message);
}
private static async Task Check()
{
foreach (var cookieList in CookieList)
{
var user = JsonReader.readJSON("dataproxy.json", "proxyDetails", "proxyuser");
var pass = JsonReader.readJSON("dataproxy.json", "proxyDetails", "proxypass");
var proxyIp = JsonReader.readJSON("dataproxy.json", "proxyDetails", "proxyip");
var proxyPort = JsonReader.readJSON("dataproxy.json", "proxyDetails", "proxyport");
var container = new CookieContainer();
var handler = new HttpClientHandler();
handler.CookieContainer = container;
var client = new HttpClient(handler);
WebProxy proxy = new WebProxy(proxyIp,Convert.ToInt32(proxyPort));
if(user != null)
{
proxy.Credentials = new NetworkCredential(user, pass);
}
client.BaseAddress = BaseAddress; try
{
handler.Proxy = proxy;
}
catch
{
LogSystem.SendMessage("Proxy Error!", Log.Type.Message);
}
whenever the proxy is failing the entire program is closing. can i know how to add the proper exception to either retry or use a new proxy or just skip ?
8 Replies
Buddy
Buddy2y ago
What are you making?
baba
baba2y ago
a program to check accounts if valid fresh made accounts when a proxy is failing i just closes i need to add a better exception i guess i code python so im new in c#
Buddy
Buddy2y ago
We absolutely do not help with that!
baba
baba2y ago
so if i come and say im learning ud help me ? im actually learning
Scratch
Scratch2y ago
no
baba
baba2y ago
and im not doing anything illegal there is no tos against creating fresh accounts and checking them
Scratch
Scratch2y ago
ah yes of course !ban 444761023585583104 developing hack tool
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.