|
I have a simple project called QuestionBank. When the clientside connects to the serverside. An exception will be throwed which message shows "Could not find the requested service". I don't know what happen because according to msdn, my project doesn't have any mistakes. OK, let me show the detail:
--- QuestionBankservice.config---
// This is a server config file.
<service>
<wellknown
mode="Singleton"
type="QuestionBankService,QuestionBankService"
objecturl="QuestionBankService.rem"
/>
</service>
<channels>
<channel
ref="http"
port="8087"
/>
</channels>
--- RemotingClient.config ---
// This is a client config file.
<client>
<wellknown
type="QuestionBankService,QuestionBankService"
url="http://localhost:8087/QuestionBankService.rem"
/>
</client>
<channels>
<channel
ref="http"
port="0"
/>
<clientProviders>
<formatter ref="binary"/>
</clientProviders>
</channels>
--- source code: Server ----
class Program
{
static void Main(string[] args)
{
// This is a console app that referenced the
// remoting module "QuestionBankService.dll".
RemotingConfiguration.ApplicationName = "QuestionBankService";
RemotingConfiguration.Configure("QuestionBankService.config", false);
Console.WriteLine("Server running...Press enter to exit.");
Console.ReadLine();
}
}
--- source code: Client ---
public class RemotingClient
{
QuestionBankService service;
public RemotingClient()
{
RemotingConfiguration.Configure("RemotingClient.config", false);
service = new QuestionBankService();
}
//Do something.
}
Is it simple? Then tell me how to resolve this problem.Thank you very much.
-- modified at 20:15 Saturday 11th March, 2006
|
|
|
|
|
How can I create a login window which will not be closable as well as which will not loose focus, so that the system couldn’t be accessed without signing in.just like cyber cafe softwares I am using c# .net
Thank You
|
|
|
|
|
first of all if u dont want to loose focus u have to call
the form as a "Dialog"..
for e.g.:
form myForm = new form()
myForm.ShowDialog();
then: if u want to disable close 'X' button.. put the following
code inside the class form{}
<br />
#region disable exit button<br />
protected override CreateParams CreateParams<br />
{<br />
get<br />
{<br />
CreateParams cp = base.CreateParams;<br />
const int CS_DBLCLKS = 0x8;<br />
const int CS_NOCLOSE = 0x200;<br />
cp.ClassStyle=CS_DBLCLKS | CS_NOCLOSE;<br />
return cp;<br />
}<br />
}<br />
#endregion<br />
<br />
hope this helps..
good coding..
|
|
|
|
|
Hi,
I'm developing an application that generates a purchase order in our business system based upon selling statistics for a supplier.
The problem is that I need to make the program more dynamic, I need to integrate an easy way for users to change the calculation methods without having to open my source.
I was thinking that they could write 3 script files: method1.cs, method2.cs and method3.cs that overrides 3 empty methods in my program but as far as I can see VSA doesn't support overriding methods in script. (or at least I couldn't)
Is there any other smart and easy way to build this? I just want the user to be able to replace 3 methods in my application without having to recompile.
Very greatfull if someone can help me!
Best regards
Dennis
|
|
|
|
|
Dennis, this sounds a bit dangerous to me. Are the calculations being changed during development or are they going to be dynamic during the operational life of the program?
If the former, just put up with recompiling. If the latter then I suggest redesigning your app to provide more control over the calculations via a form for that purpose. Allow that form some latitude with the parameters and functions available to the users but don't let them have carte blanche with your code.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
Thanks for answering Steve.
The calculations should be dynamic. I was thinking that maybe there was a way to call a method in a script file from my program instead of the opposite. I don't wan't to expose my classes to the users.
The only way I found was by using the PaxScript.NET (www.paxscript.net) since they provide the method Invoke which calls a method in a script file with parameters and sends me back the result.
I'm on a tight budget, so I can't afford this.
/Dennis
|
|
|
|
|
|
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.
|
|
|
|