Jump to content
CrazyNET

Solutie Rapidshare pentru cei cu modem SpeedTouch

Recommended Posts

Posted

Deci treaba sa cam asa, Vhaerun cu putin ajutor din partea mea a facut un program care va deconnecteaza/connecteaza conectiunea la internet.

9tpdoo.jpg

Unde scrie "Baga IP-ul Paginii" scrii ip-ul paginii modemului si dai OK, atunci te va deconnecta de la internet, trebuie sa intrii iar in program pt a te connecta... si gata ip-ul tau s-a schimbat asta doar daca ai ip dinamic nu static.

Testat pe:

Product Name: SpeedTouch 5x6

Software Release: 6.1.0.5

(va rugam sa puneti informaii despre modemul dvs. cu rezultatele)

Download Sursa:

http://rapidshare.com/files/97949276/cd.au3.html

Download .exe:

http://rapidshare.com/files/97949435/0.exe.html

Posted

Chestia asta se poate face oarecum simplu pentru orice conexiune dial-up folosind librariile RAS.

Programul creeaza conexiunea si apoi se deconecteaza. Un "while" acolo e destul de simplu de bagat :)


#include <windows.h>
#include <stdio.h>
#include <ras.h>
#include <raserror.h>

BOOL DisconnectRas()
{
BOOL bRet=FALSE;
RASCONN ras[20];
DWORD dSize,dNumber,dCount;

ras[0].dwSize=sizeof(RASCONN);
dSize=sizeof(ras);
if(RasEnumConnections(ras,&dSize,&dNumber)==0)
{
bRet=TRUE;
for(dCount=0;dCount<dNumber;dCount++)
{
if(RasHangUp(ras[dCount].hrasconn)!=0) { bRet=FALSE; break; }
}
}
return(bRet);
}

BOOL ConnectRas()
{
char szPhoneNumber[]="xxxxxx"; // nr de telefon pt conectare
char szUserName[] ="yyyyyy"; // user
char szPassword[] ="zzzzzzz"; // pass

RASDIALPARAMS rdParams;
rdParams.dwSize=sizeof(RASDIALPARAMS);
rdParams.szEntryName[0]='\0';
lstrcpy(rdParams.szPhoneNumber,szPhoneNumber);
rdParams.szCallbackNumber[0]='\0';
lstrcpy(rdParams.szUserName,szUserName);
lstrcpy(rdParams.szPassword,szPassword);
rdParams.szDomain[0]='\0';

HRASCONN hRasConn=NULL;
if(RasDial(NULL,NULL,&rdParams,0L,NULL,&hRasConn)==0) { return(TRUE); }
return(FALSE);
}

int main(int argc, char *argv[])
{
if(ConnectRas()==TRUE)
{
printf("Connected. Press any key to dissconnect\n");
getchar();
if(DisconnectRas()==TRUE)
{
printf("Disconnected\n");
}
else
{
printf("Error disconnecting\n");
}
}
else
{
printf("Error Connecting\n");
}
getchar();
return(0);
}

Linkati cu "rasapi32"

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...