|
I built a simple .net remoting program, including a server and a client.
The server has a server-activated object called "JobServerImpl", and a public event "JobEvent".
I add two event handlers at the client side, with codes like this:
this.jobServer = GetJobServer();
try
{
jobServer.JobEvent += new JobEventHandler( this.MyJobEventHandler );
}
catch( SecurityException e )
{
MessageBox.Show( e.Message );
}
The server started successfully, but when the client was loaded, a messagebox show with info "type of System.DelegateSerializationHodler and the derived types( ofSystem.DelegateSerializationHoder, for example) are not allowed to be deserialized at this security level".
I've no idea about this exception. Why? Thanks.
|
|
|
|
|
I have written a Function in C#, now i want to compile it and in crytal report i use it. Have any way to do that? If have, how to do it? help me! Thanks a lot!
superdragon
|
|
|
|
|
Dear All,
I have to execute a java application from C-sharp, but I want to know, how can I detect whether the process is complete or not?
System.Diagnostics.Process.Start("/MySetup.jar", "untitled.xml");
the code I used as above. and I will have to do another function after the MySetup.jar is ended. Can anyone give me some hints? Thanks
|
|
|
|
|
Process process = Process.Start("/MySetup.jar", "untitled.xml");
process.WaitForExit();
anotherFunction();
www.troschuetz.de
|
|
|
|
|
Thanks so much stefan.
Just have another question, do I need to call dispose or close after the process ended?
e.g process.dispose(), process.Close();
And, it looks difficult to lock the original application after running this process. Because I don't want to let user do anything after popup this process.
|
|
|
|
|
hi all,
i am trying to make a chat program, when a client send a message it will first send the message to the server then server will send to target machine , i have found examples but all of them sending message just between server and client is there anybody who has source code ore article about messaging between clients through the server?
shoul i send target ip with the message which i send to server ? i mean i will send message+targetip to server in a socket and server will open the socket and get the target ip address after then server will create new socket and send to target machine i am so confused
thanks to everyone who send message and not
|
|
|
|
|
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.
|
|
|
|