Navigation X
ALERT
Click here to register with a few steps and explore all our cool stuff we have to offer!



 1425

[C#] HELP! Using Response Codes For Hits/Fails

by Vsat - 10 July, 2020 - 03:24 AM
This post is by a banned member (Vsat) - Unhide
Vsat  
Supreme
503
Posts
101
Threads
5 Years of service
#1
Hey everyone I'm trying to make a checker but on bad accounts and banned proxies, there is no source to capture from, only response codes. Can anyone help me figure out how to capture the code and use it? Would greatly appreciate it.
[Image: MFrqQxZHObuvp4JF7i4yErQ-dF5hkdF8weBeLKAu...OuMgZo3ewr]
[Image: VOu7W4bC5BzLWZ-hrGTtAFd-Lp63qNAWOpFvUS2n...N_61tTvrGh]
[Image: L6EGRxzr1Fw5ZbgMJZH1790AuFOUnGpqaZqmQOdS...oE4IDWVh_4]
This post is by a banned member (JewOld) - Unhide
This post is by a banned member (Vsat) - Unhide
Vsat  
Supreme
503
Posts
101
Threads
5 Years of service
#3
(11 July, 2020 - 07:45 PM)Skid Wrote: Show More
didnt understand wdym

im kinda confused myself, let me try to explain it. So in this picture https://cdn.discordapp.com/attachments/7...nknown.png you can see the status codes 401 for fail 429 for ban, I need to use those for a key check, I need to do this https://gyazo.com/d984d87f632fadc166e8e75152d74c54 but in c# Lmk if that helped.
[Image: MFrqQxZHObuvp4JF7i4yErQ-dF5hkdF8weBeLKAu...OuMgZo3ewr]
[Image: VOu7W4bC5BzLWZ-hrGTtAFd-Lp63qNAWOpFvUS2n...N_61tTvrGh]
[Image: L6EGRxzr1Fw5ZbgMJZH1790AuFOUnGpqaZqmQOdS...oE4IDWVh_4]
This post is by a banned member (JewOld) - Unhide
This post is by a banned member (Suspect) - Unhide
Suspect  
Registered
75
Posts
2
Threads
4 Years of service
#5
(This post was last modified: 12 July, 2020 - 05:24 PM by Suspect.)
Why Don't you just create an Enum for the Response Codes?

 
Code:
 
private void Method()
{
try
{
}
catch(Exception ex)
{
if (ex.GetType().IsAssignableFrom(typeof(Leaf.xNet.HttpException)))
{
//var WebException = ex as WebException;
var WebException = ex as Leaf.xNet.HttpException;
var response = (int)WebException.HttpStatusCode;

if (Enum.IsDefined(typeof(CheckUsernameResponse), response))
{
CheckUsernameResponse enumValue = (CheckUsernameResponse)response;

if (enumValue == CheckUsernameResponse.Fail)
{

}
else
{

}
}
}


public enum CheckUsernameResponse
{
Fail = 401,
Ban = 429
};

 
This post is by a banned member (Vsat) - Unhide
Vsat  
Supreme
503
Posts
101
Threads
5 Years of service
#6
(12 July, 2020 - 04:01 PM)Suspect Wrote: Show More
Why Don't you just create an Enum for the Response Codes?

 
Code:
 
private void Method()
{
try
{
}
catch(Exception ex)
{
if (ex.GetType().IsAssignableFrom(typeof(Leaf.xNet.HttpException)))
{
//var WebException = ex as WebException;
var WebException = ex as Leaf.xNet.HttpException;
var response = (int)WebException.HttpStatusCode;

if (Enum.IsDefined(typeof(CheckUsernameResponse), response))
{
CheckUsernameResponse enumValue = (CheckUsernameResponse)response;

if (enumValue == CheckUsernameResponse.Fail)
{

}
else
{

}
}
}


public enum CheckUsernameResponse
{
Fail = 401,
Ban = 429
};

thanks man that really helps. I appreciate it.
[Image: MFrqQxZHObuvp4JF7i4yErQ-dF5hkdF8weBeLKAu...OuMgZo3ewr]
[Image: VOu7W4bC5BzLWZ-hrGTtAFd-Lp63qNAWOpFvUS2n...N_61tTvrGh]
[Image: L6EGRxzr1Fw5ZbgMJZH1790AuFOUnGpqaZqmQOdS...oE4IDWVh_4]
This post is by a banned member (Suspect) - Unhide
Suspect  
Registered
75
Posts
2
Threads
4 Years of service
#7
(12 July, 2020 - 09:21 PM)Vsat Wrote: Show More
(12 July, 2020 - 04:01 PM)Suspect Wrote: Show More
Why Don't you just create an Enum for the Response Codes?

 
Code:
 
private void Method()
{
try
{
}
catch(Exception ex)
{
if (ex.GetType().IsAssignableFrom(typeof(Leaf.xNet.HttpException)))
{
//var WebException = ex as WebException;
var WebException = ex as Leaf.xNet.HttpException;
var response = (int)WebException.HttpStatusCode;

if (Enum.IsDefined(typeof(CheckUsernameResponse), response))
{
CheckUsernameResponse enumValue = (CheckUsernameResponse)response;

if (enumValue == CheckUsernameResponse.Fail)
{

}
else
{

}
}
}


public enum CheckUsernameResponse
{
Fail = 401,
Ban = 429
};

thanks man that really helps. I appreciate it.

no prob, you dont have to use an Enum its just a good way to keep things organised.

 

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
or
Sign in
Already have an account? Sign in here.


Forum Jump:


Users browsing this thread: 1 Guest(s)