Click here to Skip to main content
15,923,197 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to know in a fonction of c++ if a pc use the internet to download or upload Pin
josephsaliba24-Mar-09 3:02
josephsaliba24-Mar-09 3:02 
hey guys my project is about how to limit the download and the upload from the internet, and it will be run on a server connected on many pcs, so the server will organize the limit of each pc, and manage the download and upload, and if one exceed it limit it sends a warrning message.

But i face a problem during implementation in c++, first i used the buffer to control the limit, but i don t know how i can know if any pc use the internet browser to download or upload and how i can get the data from the internet browser and transfer it to bytes and store it in the buffer:
this is my code:


setlimit(int limit, int nbofpc)
{
Float limitbypc;
Limitbypc = limit/nbofpc;
For(int i=0; i<nbofpc;i++)>
Char buffer limitbypc;
Return 0;
} //and this method is to give the limit to each pc connected to the server

if(download) //how i can know 
{
void downloadlimit( )
{ AnsiString IP;
For(int i=0; i<nbofpc;>Switch (IP)
{Case ‘10.15.1.157’: bufferlimitbypc = fputs(data); //?????? how i can get the data from the internet browser and store it by bytes in the buffer.
If(sizeof(data)) == sizeof(buffer)
WriteString ("you can’t download more"); break;
Case ’10.15.1.158’: bufferlimitbypc = fputs(data); break;//?????????
If(sizeof(data)) == sizeof(buffer)
WriteString ("you can’t download more"); break;
……………
Case’10.15.1.164’: ……….; break; 

}
}
Return 0;}} 

if(upload) //how i can know ??????????  
{
void uploadlimit( )
{ AnsiString IP;
For(int i=0; i<nbofpc;>Switch (IP)
{Case ‘10.15.1.157’: bufferlimitbypc = fputs(data); //??????how i can get stor the data befor upload it by bytes in the buffer  
If(sizeof(data)) == sizeof(buffer)
WriteString ("you can’t upload more"); break;
Case ’10.15.1.158’: bufferlimitbypc = fputs(data); break;//?????????
If(sizeof(data)) == sizeof(buffer)
WriteString ("you can’t upload more"); break;
……………
Case’10.15.1.164’: ……….; break; 

}
}
Return 0;}} 

thanks
joseph
AnswerRe: how to know in a fonction of c++ if a pc use the internet to download or upload Pin
led mike24-Mar-09 4:46
led mike24-Mar-09 4:46 
AnswerRe: how to know in a fonction of c++ if a pc use the internet to download or upload Pin
David Crow24-Mar-09 4:47
David Crow24-Mar-09 4:47 
QuestionHow to navigate between corresponding .cpp and .h file in VS2008? Pin
followait24-Mar-09 2:54
followait24-Mar-09 2:54 
AnswerRe: How to navigate between corresponding .cpp and .h file in VS2008? Pin
Sarath C24-Mar-09 3:05
Sarath C24-Mar-09 3:05 
AnswerRe: How to navigate between corresponding .cpp and .h file in VS2008? Pin
Jijo.Raj24-Mar-09 3:31
Jijo.Raj24-Mar-09 3:31 
AnswerRe: How to navigate between corresponding .cpp and .h file in VS2008? Pin
Rolf Kristensen25-Mar-09 10:33
Rolf Kristensen25-Mar-09 10:33 
QuestionDeleted File Pin
john563224-Mar-09 2:53
john563224-Mar-09 2:53 
AnswerRe: Deleted File Pin
Sarath C24-Mar-09 3:03
Sarath C24-Mar-09 3:03 
AnswerRe: Deleted File Pin
Jijo.Raj24-Mar-09 4:09
Jijo.Raj24-Mar-09 4:09 
GeneralRe: Deleted File Pin
john563225-Mar-09 1:54
john563225-Mar-09 1:54 
QuestionProblem in struct Pin
NewVC++24-Mar-09 2:40
NewVC++24-Mar-09 2:40 
AnswerRe: Problem in struct Pin
Iain Clarke, Warrior Programmer24-Mar-09 2:45
Iain Clarke, Warrior Programmer24-Mar-09 2:45 
AnswerRe: Problem in struct Pin
Michael Schubert24-Mar-09 2:47
Michael Schubert24-Mar-09 2:47 
GeneralRe: Problem in struct Pin
NewVC++24-Mar-09 2:55
NewVC++24-Mar-09 2:55 
Questionhlow.. Pin
merry jermamae arcilla24-Mar-09 2:23
merry jermamae arcilla24-Mar-09 2:23 
AnswerRe: hlow.. Pin
Michael Schubert24-Mar-09 2:31
Michael Schubert24-Mar-09 2:31 
AnswerRe: hlow.. Pin
David Crow24-Mar-09 2:35
David Crow24-Mar-09 2:35 
GeneralRe: hlow.. Pin
Michael Schubert24-Mar-09 2:38
Michael Schubert24-Mar-09 2:38 
AnswerRe: hlow.. Pin
Iain Clarke, Warrior Programmer24-Mar-09 2:49
Iain Clarke, Warrior Programmer24-Mar-09 2:49 
GeneralRe: hlow.. Pin
Michael Schubert24-Mar-09 2:55
Michael Schubert24-Mar-09 2:55 
AnswerRe: hlow.. Pin
Sarath C24-Mar-09 2:57
Sarath C24-Mar-09 2:57 
AnswerRe: hlow.. Pin
CPallini24-Mar-09 3:03
mveCPallini24-Mar-09 3:03 
AnswerGet back in the Soapbox Kyle Pin
led mike24-Mar-09 4:36
led mike24-Mar-09 4:36 
AnswerRe: hlow.. Pin
Rick York24-Mar-09 11:17
mveRick York24-Mar-09 11:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.