|
first create second form on your first form after then you can call public variables of your form1 using Form1.yourPublicVar . i mean on buttonclick event write code like this
mySecondForm Form2 = new mySecondForm();
Form2.yourPublicVar = what you want;
openup your heart and let the sun shine in
|
|
|
|
|
I don't seem to be able to extract the public variable...
I did everything you said, can you make a sample project and sned it to me??
If so please reply....
thanks in forward
sorry I'm just a noobie
|
|
|
|
|
i am busy now but if you wait i will make a sample project for you (about 10 hours later)
openup your heart and let the sun shine in
|
|
|
|
|
THNX, let me know if you have it
|
|
|
|
|
i sent you a win project about transferring variables between forms i hope it helps you
bys
openup your heart and let the sun shine in
|
|
|
|
|
I am trying to develop a C# library that will be used by other class libraries in our orginization. I am have great difficulties in getting our other class libraries to be able to call methods of this library. We can create an instance of the public classes in my library but are unable to call any of the public methods or properties (even static ones) of that instance. Can anyone make a suggestion as to what I am missing here?
|
|
|
|
|
Give us more information.
What version of the framework are you using, how are you refrencing the DLL, are you getting any erros, if yes what errors, some code would be nice too...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Thanks for the help. We have solved the problem. It was an internal security issue.
Thanks again
|
|
|
|
|
i need to find the host name who is using the 61.247.251.97 IP.
my program works well .
when there is an IP confit for 61.247.251.97
how can i find the host names who is having 61.247.251.97?
using System;
using System.Net;
class GetAddress
{
public static void Main(string[] argv)
{
if (argv.Length != 1)
{
Console.WriteLine("Usage: GetAddress address");
return;
}
IPAddress test = IPAddress.Parse(argv[0]);
IPHostEntry iphe = Dns.GetHostByAddress(test);
Console.WriteLine("Information for {0}",
test.ToString());
Console.WriteLine("Host name: {0}", iphe.HostName);
foreach(string alias in iphe.Aliases)
{
Console.WriteLine("Alias: {0}", alias);
}
foreach(IPAddress address in iphe.AddressList)
{
Console.WriteLine("Address: {0}", address.ToString());
}
}
}
JAYARAJ
|
|
|
|
|
If you're trying to find BOTH machine using the same address, you can't do it using normal methods because the normal rules for IP networking are being violated. You actually have to start digging into the network routing equipment to find where the other machine is.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
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
|
|
|
|