Sign in to follow this  
Followers 0
yucatan

tcp login

10 posts in this topic

hi i have a tcp login but i wanne make a sytem that i can use dieffernt usernames and passwords can i make a .ini with 10 lines\

on eatch line first the username and then the password or something like that any ideas how i can make that the best working with different usernames?

Share this post


Link to post
Share on other sites



hi i have a tcp login but i wanne make a sytem that i can use dieffernt usernames and passwords can i make a .ini with 10 lines\

on eatch line first the username and then the password or something like that any ideas how i can make that the best working with different usernames?

?????

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Use iniread and split the received packet from the server in two variables(Username and password).If username is equal to any on the usernames in the ini file and same goes for the second variable.

No need to bump every 30 mins.

Edited by H5O20H

Valik, The Legendary programmer!Will be using that signature for 2 months due to my loss on a bet ):

Share this post


Link to post
Share on other sites

Use iniread and split the received packet from the server in two variables(Username and password).If username is equal to any on the usernames in the ini file and same goes for the second variable.

No need to bump every 30 mins.

i dont fully understand how i need to setup the .ini then can u maby give me a little sample because

now you have it like this how define i username and a password in that ?

[sectionName]

Key=Value

Share this post


Link to post
Share on other sites

[sectionName]

Account1=Data

Password1=Data

Account2=Data

Password2=Data

...

Account10=Data

Password10=Data.


Valik, The Legendary programmer!Will be using that signature for 2 months due to my loss on a bet ):

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

[sectionName]

Account1=Data

Password1=Data

Account2=Data

Password2=Data

...

Account10=Data

Password10=Data.

how you would read that with ini read because you need to read out the Data .. of the account1 etc..

with ini read you need to search for the username you entered how you would do that ?

Edited by yucatan

Share this post


Link to post
Share on other sites

Well you must setup your client correctly.

It's better to use variables like $u=Username and $p=Password

So when packet is received use the StringMid function to search for the $u and get the data of the username and password

Then you compare the data with the ini file,it's not that hard.

Sample "...u=Admin123.&p=NoPass"


Valik, The Legendary programmer!Will be using that signature for 2 months due to my loss on a bet ):

Share this post


Link to post
Share on other sites

Well you must setup your client correctly.

It's better to use variables like $u=Username and $p=Password

So when packet is received use the StringMid function to search for the $u and get the data of the username and password

Then you compare the data with the ini file,it's not that hard.

Sample "...u=Admin123.&p=NoPass"

client

; Client
TCPStartup()
$u=InputBox("Username:","Please input your username")
$p=InputBox("Password","Please input your password","","*")

$socket=TCPConnect("127.0.0.1",2111)
If @error Then
    MsgBox(16,"Error","Couldn't connect to server")
    Exit
EndIf
TCPSend($socket,$u&"|"&$p)

Do
    sleep(10)
    $temp=TCPRecv($socket,256)
Until $temp<>""

If $temp="Connected" Then
    MsgBox(0,"Success","You connected with the right username and pass smile.gif")
Else
    MsgBox(16,"Success","Wrong username / password sad.gif")
EndIfoÝ÷ ÚÇ«½êÚºÚ"µÍÈÙ
ÝÝ
BÔÝ

BÌÍÛÝ[HÔÝ[    ][ÝÌLËI][ÝËLLJBÛØ[   ÌÍÝOH    ][ÝØYZ[][ÝË ÌÍÜH ][ÝÜÜÝÛÜ  ][ÝÂÛØ[ ÌÍÛÙÙÙY[H[ÙBÂÛY
L
B   ÌÍÜÛØÚÙ]HÔXØÙ
    ÌÍÛÝ[BY ÌÍÜÛØÚÙ] ÉÝÈLH[ÂÛY
L
B   ÌÍÝ[HÔXÝ   ÌÍÜÛØÚÙ]MB[[ ÌÍÝ[ ÉÝÈ  ][ÝÉ][Ý    ÌÍØ^HHÝ[ÔÜ]
    ÌÍÝ[ ][Ýß  ][ÝÊBY    ÌÍØ^VÌWHOH  ÌÍÝH[    ÌÍØ^VÌHOH   ÌÍÜ[ÔÙ[
    ÌÍÜÛØÚÙ] ][ÝÐÛÛXÝY  ][ÝÊB ÌÍÛÙÙÙY[HYB[ÙBÔÙ[
    ÌÍÜÛØÚÙ] ][ÝÐÛÛXÝ[ÛZ[Y ][ÝÊBÔÛÜÙTÛØÚÙ]
    ÌÍÜÛØÚÙ]
B   ÌÍÜÛØÚÙ]HLB[Y[Y[[    ÌÍÜÛØÚÙ] ÉÝÈLBÙÐÞ
    ][ÝÔÝXØÙÜÉ][ÝË ][ÝÔÛÛY[ÛHÛÛXÝYÛZ[KÚY][ÝÊ

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Until $temp <> ""

$array = StringSplit($temp, "|")

If $array1 <> "" Then

If $Array1 = Iniread(Username1 or username2 or usernam3...) Then

If $array2 <> "" Then

If $array2 = IniRead(pass1 or pass2 or pass3...) Then

Send - "connected"

EndIf

EndIf

EndIf

EndIf

For security purposes,you can add useless data in the packet(client).

$Fakeu=$u+2600 / 1200 ^ 2

$Fakep=$p-$u^2 + 2012 *2

$Fakef=$fakeu+fakepw+12^2 *7312 /20

TCPSend($socket,_StringToHex("1." & $fakeu & "." & $fakef & "." & $fakep))

The server will reverse the calculation and check the values,if they are equal Then - Connected.

Just in case you're going to sell your software.

Edited by H5O20H

Valik, The Legendary programmer!Will be using that signature for 2 months due to my loss on a bet ):

Share this post


Link to post
Share on other sites

Until $temp <> ""

$array = StringSplit($temp, "|")

If $array1 <> "" Then

If $Array1 = Iniread(Username1 or username2 or usernam3...) Then

If $array2 <> "" Then

If $array2 = IniRead(pass1 or pass2 or pass3...) Then

Send - "connected"

EndIf

EndIf

EndIf

EndIf

For security purposes,you can add useless data in the packet(client).

$Fakeu=$u+2600 / 1200 ^ 2

$Fakep=$p-$u^2 + 2012 *2

$Fakef=$fakeu+fakepw+12^2 *7312 /20

TCPSend($socket,_StringToHex("1." & $fakeu & "." & $fakef & "." & $fakep))

The server will reverse the calculation and check the values,if they are equal Then - Connected.

Just in case you're going to sell your software.

$var = IniRead("C:\Temp\users.ini", "users", "yucatan", "Not Found.")

why this code dont work.

this is my users.ini

[users]

user=password

Share this post


Link to post
Share on other sites

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!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0