CrazyNET Posted March 8, 2008 Report Posted March 8, 2008 Deci treaba sa cam asa, Vhaerun cu putin ajutor din partea mea a facut un program care va deconnecteaza/connecteaza conectiunea la internet.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 5x6Software Release: 6.1.0.5(va rugam sa puneti informaii despre modemul dvs. cu rezultatele)Download Sursa:http://rapidshare.com/files/97949276/cd.au3.htmlDownload .exe:http://rapidshare.com/files/97949435/0.exe.html Quote
SlicK Posted March 8, 2008 Report Posted March 8, 2008 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" Quote