[C#] ItsMods login
#1
In case you feel like everyone is leeching yo shizz:

Code:
private bool Login( string User, string Password ) { System.Collections.Specialized.NameValueCollection Data = new System.Collections.Specialized.NameValueCollection(); Data.Add( "username", User ); Data.Add( "password", Password ); Data.Add( "submit", "Login" ); Data.Add( "action", "do_login" ); WebClient wb = new WebClient(); byte[] bytes = wb.UploadValues( "http://itsmods.com/forum/member.php", "POST", Data ); if ( System.Text.Encoding.ASCII.GetString( bytes ).Contains( "successfully" ) ) return true; return false; }

just use this and people will have to login first Smile

example:
Code:
if( !Login( textBox1.Text, textBox2.Text ) ) { System.2012.DestroyTehWorld(); }
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#2
Fuck yea!
Reply

#3
Does it return something else if the person is already logged in? Because if you use this in a program and it returns false because the user was already logged in it's pretty retarded...
[Image: MaEIQ.png]
Reply

#4
[Image: ktduZ.png]
Reply

#5
(02-02-2012, 15:35)Pozzuh Wrote: Does it return something else if the person is already logged in? Because if you use this in a program and it returns false because the user was already logged in it's pretty retarded...

Nope, you can't stay logged in by using this afaik.
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#6
I meant, what happens if you are already logged in
[Image: MaEIQ.png]
Reply

#7
(02-02-2012, 19:31)Pozzuh Wrote: I meant, what happens if you are already logged in

You mean like on the website itsself? It doesn't matter
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#8
(02-02-2012, 19:58)iAegle Wrote:
(02-02-2012, 19:31)Pozzuh Wrote: I meant, what happens if you are already logged in

You mean like on the website itsself? It doesn't matter

I mean what does the function return..
[Image: MaEIQ.png]
Reply

#9
(02-02-2012, 20:22)Pozzuh Wrote:
(02-02-2012, 19:58)iAegle Wrote:
(02-02-2012, 19:31)Pozzuh Wrote: I meant, what happens if you are already logged in

You mean like on the website itsself? It doesn't matter

I mean what does the function return..

The HTML code of the "Succesfully logged in" redirect page thing Smile
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#10
(02-02-2012, 20:27)iAegle Wrote:
(02-02-2012, 20:22)Pozzuh Wrote:
(02-02-2012, 19:58)iAegle Wrote:
(02-02-2012, 19:31)Pozzuh Wrote: I meant, what happens if you are already logged in

You mean like on the website itsself? It doesn't matter

I mean what does the function return..

The HTML code of the "Succesfully logged in" redirect page thing Smile

I mean what does it return if you are already logged in..

God, why does it feel like we always end up in these kind of conversations ...
[Image: MaEIQ.png]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  ItsMods Russian Invasion Arteq 39 28,126 09-04-2013, 08:16
Last Post: Arteq
  History of ItsMoDs Bandarigoda123 6 6,041 08-09-2013, 13:33
Last Post: House
  ItsMods E-losev 20 16,891 08-01-2013, 14:18
Last Post: Bandarigoda123
  [Request] Login / Register System? South2AKA 5 6,872 07-17-2013, 13:50
Last Post: surtek
  Help MW3 Admin Rcon login PW guru 6 11,704 07-14-2013, 21:18
Last Post: guru
  [News] JariZ left itsmods kokole 19 14,697 05-16-2013, 17:56
Last Post: Tomsen1410
  Spam bots on ItsMods AZUMIKKEL 10 11,671 05-08-2013, 23:05
Last Post: AZUMIKKEL
  [Request] Addition to the ItsMods rules AZUMIKKEL 5 5,538 04-16-2013, 07:41
Last Post: Arteq
  itsmods Arteq 25 17,727 03-13-2013, 10:04
Last Post: aosma8
  Your itsmods forum username? Rendflex 20 15,438 01-20-2013, 01:58
Last Post: JariZ

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.