|
Hello sa_keles,
Do not confused. it is not a difficult subject. you just create one structure that define as like this.
struct msgPkt
{
char[] sender = new char[10];
char[] recerver = new char[10];
char[] msg = new char[100];
}
when any one login it will register there current IP address so no to give every time IP with every msgs. just give sender & reciever names.
Here i specified all field as char array becoz in network operation it is better that bytes of all field are fix & known size.
And if you use UDP insted of TCP then it is best for this.
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|
|
thanks for your reply Divyang Mithaiwala ,
i know nothing about socket programming so i am confused but i am searching i will try your said is there any article about socket programming you advise me? i hope i can manage
have a nice day
|
|
|
|
|
|
hi again ,
i am trying to use struct but getting error could you write me an example please , i have never used struct before
openup your heart and let the sun shine in
|
|
|
|
|
i have resolved the problem
openup your heart and let the sun shine in
|
|
|
|
|
i need print only numbers after comma
example
double x=33.452
Console.WriteLine(x);
output
452
how I do this ?
|
|
|
|
|
Heres a simple way:
static void Main(string[] args)
{
double x = 33.452;
string number = x.ToString();
char[] sperator = { '.' };
string[] seperate = number.Split(sperator);
double xSplit = Convert.ToDouble(seperate[1]);
Console.WriteLine(xSplit);
}
That will output 452 to the console. There might be an easier way though I'm not sure.
Hope that helps
|
|
|
|
|
I like your's with the colored
background better...
|
|
|
|
|
Probably and eaiser way...But
this works.
double d = 3.14;
string s = d.ToString();
char[] delimiter = { '.' };
string[] a = s.Split(delimiter);
Console.WriteLine(a[1]);
gl-Paul
|
|
|
|
|
I put the exact same thing 8 min eariler
|
|
|
|
|
didn't see your post...From
your '???' do you not realize
how two people can post within
an 8 minute perion?
|
|
|
|
|
I'm not insulting you I just thought it was kind of funny that we said the exact same thing.
|
|
|
|
|
Hopefully its' a good thing....
|
|
|
|
|
These message boards are practically like instant messaging lol.
|
|
|
|
|
yes...Coding today is almost too
easy with all the help availible
in realtime...;)
|
|
|
|
|
Unfortunately the other solutions will fail under other cultures. Do the following instead:
double x = 33.452;
Console.WriteLine(x % Math.Floor(x));
|
|
|
|
|
This works for any culture. It also handles the case where there is no fractional digits, instead of causing an exception.
double x = 33.452;
string number = x.ToString(CultureInfo.InvariantCulture);
int pos = number.IndexOf('.');
if (pos == -1) {
Controle.WriteLine();
} else {
Console.WriteLine(number.Substring(pos + 1));
}
---
b { font-weight: normal; }
|
|
|
|
|
I've got an app as described in the subject. I am trying to write an update class that will handle changes to the database structure. I can figure out how to create a new tables using "CREATE TABLE" statements with the ODBCCommand object. What I cannot figure out is how to set field properties. Anything other than the basic (fld_name fld_type,...) statements result in an "[Error 42000] Syntax error in CREATE TABLE statement".
Mostly what I'd like to be able to do is set default values and create auto-number fields. If anyone can give me a bit of guidance on this or direct me to a useful link, I'd greatly appreciate it.
TIA,
Eric
|
|
|
|
|
How would I go about finding the free space on a given disk?
Thanks for any help.
|
|
|
|
|
check out 'DriveInfo class' in
the help menu. The sample seems
to be what you need.
gl-Paul
|
|
|
|
|
Yup, exactly what I need.
Thanks
|
|
|
|
|
Hi,
I'd like to make a listbox display multilines to user without using scrolldown when another event is clicked. And the same listbox shows only one item when another event is clicked.
Ex: when you click a button A, then a listbox B shows multilines of items.
And when you click the button A again, the listbox B shows only one line.
Thanks.
Kyah
|
|
|
|
|
Do you prefer any address about this algorithm or do you have any source code about them.
Thank you.
|
|
|
|
|
Are you trying to simulate multitask scheduling, or are you trying to apply these concepts to real task queue processing?
--
I've killed again, haven't I?
|
|
|
|
|
real task queue processing
|
|
|
|