|
thanks for your info Dave. By the way, What namespace or library do i need to investigate in order to write a bandwidth usage monitoring application? Do i need to create a client application and install it in the host machine within a network? the main function of my application will be monitoring the bandwidth usage of each machine within a LAN. And those machines are connected to internet through a router/switch/hub.
You mentioned that monitoring the bandwidth usage is best done by the switch the machinese is connected to. How can this be done? By monitoring every port of the switch? Can you tell me in details?
|
|
|
|
|
The switch already monitors all the ports, all you need to do is communicate with the switch to get the data, provided your switch can do this.
The problem with doing it in a client/server monitoring solution is that the usage will NEVER be 0. Even if the machine is not communicating with anything on the internet. This is because when the monitor starts, the usage will be 0, but will increase the second your client sends it "Heym my usage is 0" to the server. You'll get a steady "hum" from your monitoring software as is constantly sends usage data over the very network card it's monitoring.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How to communicate with the switch/router/hub to get the bandwidth usage data? Pls tell me in which field/namespace/library i need to study on. Thanks.
|
|
|
|
|
There isn't one. What you write depends entirely on how your particular switch, router, whatever exposes this information, if at all.
You'll will PROBABLY have to write a mini Telnet client into your app to get at this stuff.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Here my program:
#include <io.h>
#include <stdio.h>
#include <math.h>
#include <time.h>
int main()
{
int bets, bets_made, bet_num[50], betmoney[50];
short roulette_choice, spinval;
double num_bets;
int betcheck = -1;
long cash = 500;
short bet = 0;
while ( !bet )
{
menumain: printf ( "\n\n\n *** Roulette ***\n" );
printf ( "(1): Place a bet\n" );
printf ( "(2): Check your cash\n" );
printf ( "(3): Mortage your house\n" );
printf ( "(4): Quit Roulette\n" );
printf ( "(5): Retire\n" );
printf ( "Please enter your choice: ");
scanf ( "%d", &roulette_choice );
switch (roulette_choice)
{
case 1: printf ( "\n\n\nHow many bets will you place?" );
scanf ( "%d", &num_bets );
num_bets = num_bets - 1;
bets_made = -1;
while (bets_made < num_bets)
{
bets_made++;
beginning:
printf ( "\nWhat number will you place a bet on (0-36)? " );
scanf ( "%d", &bet_num[bets_made] );
if ( 36 < bet_num[bets_made] || 0 > bet_num[bets_made] )
{
goto beginning;
}
printf ( "How much will you bet on number", "%d", &bet_num[bets_made], "?" );
scanf ( "%d", &betmoney[bets_made] );
}
bet= 1;
break;
case 2: printf ( "\n\nYou have $", "%d", &cash, "at this time." );
break;
case 3: printf ( "\n\nI think you need to go cool it for a while." );
return 0;
case 4: printf ( "\n\nReturning to the main menu now." );
return 0;
case 5: return 0;
default: printf ( "\n\nStay away from the bar for a while would ya?" );
goto menumain;
}
}
spinval = rand () %37;
printf ( "\n\n\nThe winning number is ", "%d", &spinval, "!" );
while (betcheck < num_bets )
{
betcheck ++;
if ( bet_num[betcheck] - spinval == 0 )
{
printf ( "\n\n\nYou won with the number ", "%d", &bet_num[betcheck], "!" );
cash = cash + (betmoney[betcheck] * (37.00/num_bets));
bet = betmoney[betcheck] * (37.00/(num_bets + 1));
printf ( "\nYou made $ ");
scanf ( "%d", &bet);
goto main;
}
}
printf ( "\n\nSorry pal, better luck next time\n" );
goto main;
}
Please tell me where is do mistake. Thank you.
|
|
|
|
|
You've got a lot to learn how forums work.
This is the C# forum, not C++.
All you've done is post your code and ask where the problem is. What problem? A description of what your expecting and what your seeing as the problem might help. Yes, I'm too lazy to cut and paste your code into a C++ project to see what it's doing.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i'm doing C Programming for the American Roulette. can u tell me da prob in my program? do u have some sample on roulette? can u send me please? thank you!!
|
|
|
|
|
I hate repeating myself.
YOU have to tell us what the problem is. We're not going to copy and paste your code into a project just to diagnose whatever problem you're not telling us about. What problem are we looking for?
Just posting your code and saying "it won't work" will NOT get you a solution to the problem.
You also have to post in the correct forum. You're posting this question in the C# Forum. You want the Visual C++[^] Forum.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i hate repeating myself too. and yeah by the way where's the forum then if not here? i'm doing C Programming. and not Visual C++.******
|
|
|
|
|
Look at the top of any forum page. You'll find the link to Visual C++. Since C is just a subset of C++...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave is right, but in addition, did you mean to write a C program, or C++ ? This program is in C not C++. you can still ask in the C++ forum, of course.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I have a application by C# language.I want to encapsulate it become complete application in order to use anywhere.
Please help me.
Thanks!
|
|
|
|
|
Are you saying you need to know that the .NET runtime has to be installed on any machine so your code can run on it ? That's what's needed to ship your app.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Code Start
//Crystal Report Object
CrystalReport2 cp = new CrystalReport2();
CReport cp1 = new CReport();
//Form Load Event
private void Form2_Load(object sender, System.EventArgs e)
{
crystalReportViewer1.ReportSource = cp;
}
//Link Label Click Event
private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
try
{
string empid = textBox1.Text.Trim();// H-B39728F employee id
SqlConnection con = new SqlConnection("server=SK-WAQAS;uid=sa;pwd=Butt;database=pubs");
SqlDataAdapter daemp = new SqlDataAdapter("Select * From employee where emp_id= '" + empid + "'", con);
DataSet ds = new DataSet();
daemp.Fill(ds,"employee");
cp.SetDataSource(ds);
con.Close();
}
catch(Exception ce)
{
MessageBox.Show(ce.Message);
}
}
// End Code
When i run this code no record show in Crystal Report. Please tell me where is do mistake. I want to show record in crystal report on the base of emp_id , i use pubs database on Sql server 2000.
Thanks in advance.
|Muhamad Waqas Butt|
waqasb4all@yahoo.com
www.sktech.freewebspace.com
|
|
|
|
|
i'm having this type of error 'Underfined label 'main' in function main' in my program. please can anyone be of help here. thank you! do mail me for more information.
Arshad
|
|
|
|
|
What do you not understand? The compiler message is very clear: 'Underfined label 'main' in function main'
You're using a label called "main" in your function "main" and this label is not defined.
Most likely you've got a syntax error, but without even giving the full and correct error (the compiler didn't output "Underfined" for sure!) or the code line the error occurrs on you won't get any decisive help!
mav
|
|
|
|
|
|
hi dears ,
I have a problem
I create a class with delegate and event !
when i used it in another class with remoting , i recevied this Error :
"Type System.DelegateSerializationHolder and the types derived from it (such as System.DelegateSerializationHolder) are not permitted to be deserialized at this security level."
what is probelm?
|
|
|
|
|
Hello,
I am wondering if anyone can point me in the direction of a nice bit of code to draw a tree structure. Not the tree that is one of the default windows controls, but the list tree structure
O
/ \
O O
/ | \ \
O O O O
like that.
Thanks
The wisest of the wise may err. - Aeschylus
|
|
|
|
|
How does one go about making part of the messagebox() show a web link?
something to the effect of:
MesageBox.Show("Help File Not Found: \n\nTo download the latest Helpfile, go here:" + SomeSortaWeblink(http://www.mysite.com))
Any help is truly Appreciated
-- modified at 0:30 Sunday 2nd October, 2005
|
|
|
|
|
You can't. You'd have to create your own dialog box that has a Link control in it.
Picture a huge catholic cathedral. In it there's many people, including a gregorian monk choir. You know, those who sing beautifully. Then they start singing, in latin, as they always do: "Ad hominem..."
-Jörgen Sigvardsson
|
|
|
|
|
There is no direct solution to this.
What you can do is , write a Customized Message Box (your own Form) which can include this.
Regards
Mahesh
Regards
Mahesh
|
|
|
|
|
i need to serialize an object but before to serialize i want to encrypt it
How can i encrypt? Can someone decrypt it with some program?
|
|
|
|
|
Hi,
don't serilize it directly to a file. First serialize it into a MemoryStream. Then put that one into a CryptoStrem (this article should give you the basic idea on how to use it). The output of that one can then finally be written to a file (FileStream class).
If you use the cryptographic classes correctly it will be very hard to nearly impossible for someone else to decrypt it.
|
|
|
|
|
Hi, tnx for your advise, but just one consideration:
if i use these lines in my code
cryptic.Key = ASCIIEncoding.ASCII.GetBytes(“ABCDEFGH”);
cryptic.IV = ASCIIEncoding.ASCII.GetBytes(“ABCDEFGH”);
it can be get in back by hackers opening my application in assembly code or just if it crash for whatever cause.
Isn't it?
My trouble is can someone got these keys? so use to decrypt manually the stream?
|
|
|
|