|
I have 2 classes namely Client.cs and Server.cs
Each class has a main() method...
So it gives me an error:
More than one entry point
Can i call a class from another class in C#?
If so how can i do it?
|
|
|
|
|
You can never call a class, you can only call methods (ok and a few others things, too much detail..)
If they would be allowed to both have a Main, then which one would start? Should the program start out with 2 threads?
But, probably, you have 2 programs there that have to be run as 2 programs, because that's what they are. So put them in 2 different projects..
|
|
|
|
|
Actually each class may have its Main method. If you have more than one Main method you just have to specify your startup object (the class that contains the main which you want to start).
|
|
|
|
|
You're making it more complicated than it needs to be.
If you have a client and a server object, you don't want to start just one of them anyway.
|
|
|
|
|
No, I'm not.
I do have projects which could be separated into more projects but I do like to keep it simple in a solution. When I need it to run a just choose the startup object. This is working for me when doing throwaway test code, without the complexity of a new project.
|
|
|
|
|
This is pretty beginner stuff. You should google "object instantiation", "constructor" and so on.
|
|
|
|
|
how do i read the text inside the current running windows application?
|
|
|
|
|
I'm sorry, but we have no idea what you are talking about.
Maybe you can explain what is the problem, where the problem exist and maybe you can put some (SOME, not 2 pages of code) code in here to clearify what you mean.
If you explain the problem better, we will most probably give you anwsers.
|
|
|
|
|
i am sorry for the unclear posted question. now i would try to explain in detail. i havenot written much code yet. but my problem is, i have to read the EULA(Enduser Licence Agreement) text through my program while installing the .exe file.i do not know how could i access that.hope you would understand this and give ur advice to solve this.
|
|
|
|
|
So you are making an installer and you would like to read an EULA, as like a text file?
Use a stream reader for this problem.
|
|
|
|
|
thanks for your reply. see you soon with more douts
|
|
|
|
|
Dear All,
I am getting an embedResource Text File using following code, but when i want to write into it.
It gives me an error, "Stream does not support writting".
[code]
System.Reflection.Assembly ass=Assembly.GetExecutingAssembly();
System.IO.Stream s=ass.GetManifestResourceStream("testLogin.test.txt");
byte[] array=new byte[s.Length];
s.Read(array,0,Convert.ToInt32(s.Length));
//here i am writting
s.Write(myarray,0,myarray.Length); //the error is here
[/code]
The question is how can i make it read/write.
The file is embededResource.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
first i opened a form in windows application. later i added a crystal report to the application and added some information to the crystal report by using microsoft oledb provider for sqlbut it ishowing the error.the code iused there is
cust c =new cust();
crystalreportviewer1,reportsource=rpt;
it is showing an error like
Error 1 'crdemo1.cust' does not contain a definition for 'rpt'
|
|
|
|
|
Hi. I create a usercontrol. It's name is Imagelists and it holds images as a list. And it has indexer property as
public Image this[int i]
when i use it in an event as Imagelists1[2]. i want to see the second image name as a property. when i call Imagelists1[3].Name, let it returns me the name of image. But i couldn't see the Name property when i use it with it's indexer. if i don't use indexer an i use like ImageLists1.Name, i can see the Name property. I just want to see like Imagelists1[3].Name and it returns me the name of 3rd image. How could i do this?
|
|
|
|
|
Hello,
I have a problem in my application and I don't really know how to solve it:
unsafe public System.Collections.IEnumerator GetEnumerator()
{
char[] sString1 = new char[max];
for (int numer = 0; numer < roz; numer++)
{
fixed (char* sString = sString1)
{
for (int i = min; i <= max; i++)
{
string a = brute(sString, 2, sString1, numer);
yield return a;
}
}
}
}
private string brute(char* sString, int nLen, char[] sPoczatek, int num)
{
while (nLen > 0)
{
if (nLen == 1)
{
for (int i = num; i < zn.Length; i += roz)
{
sString[0] = zn[i];
brute(sString + 1, nLen - 1, sPoczatek, num);
}
}
else
{
for (int i = 0; i < zn.Length; i++)
{
sString[0] = zn[i];
brute(sString + 1, nLen - 1, sPoczatek, num);
}
}
}
return sPoczatek.ToString();
}
Error 1 Unsafe code may not appear in iterators
Is that possible to use GetEnumerator() with unsafe code?
111
modified on Sunday, February 22, 2009 11:38 AM
|
|
|
|
|
hii all
i want to only authenticate windows live id / hotmail in c# windows application.
i dont want to send emails. pls help
thanks in advance.
|
|
|
|
|
|
Hi dears.
I'm going to save a string in a DOC file in a specific format.
Could you tell me how I can do it ?
Thanks in advance.
|
|
|
|
|
help me please i 'm in an urgent situation,
i have 2 project in my solution ,i refrance the B project with A project,
i run the project and use it whitout any error,but when i try to publish
an unexpected error unleashed as below :
"Error 159 Could not find file 'Microsoft.Windows.CommonLanguageRuntime, Version=2.0.50727.0'.project"
what can i do, i'm runing out of time,help plz!
|
|
|
|
|
Its a bug in VS 2005
http://support.microsoft.com/kb/907757[^]
more info[^]
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi,
In my program, serialport.Ctsholding and serialport.RtsEnable are used every second to check signal input. serialport.Datareceived is used to receive different data. It seems that they have conflict with each other. When Ctsholding and RtsEnable are being used,datareceiving is affected in time wise.
Any suggestions why this happens and how to solve the problem? If required, I can put up my codes.
Thanks in advance.
Charles
|
|
|
|
|
http://technet.microsoft.com/en-us/library/ms187320.aspx[^]
I'm wondering if anyone has built this scheduler structure within their C# application. It seems very flexible. Essentially all I'm really looking for is a function to generate the Next_Occurance date and time from the other values given.
Has anyone tackled this?
Thanks.
|
|
|
|
|
I using datetimepicker and when i get the value that the user was choose i get the time with seconds.
This field is read only and i can do "get" but i cant do "set".
My problem is that i want to drop this seconds and i don't know how.
I try to avoid of create new DateTime object and with i parser this object to set the seconds to be "00".
Thanks.
|
|
|
|
|
|
It depends on the specific control, but generally the format would be somthing like hh:mm....the default is hh:mm:ss, so drop the ss for dropping the seconds from displaying.
|
|
|
|