|
The class 'char' has few static methods.
One of them is 'IsChar' or something like that.
|
|
|
|
|
Hi,
I have a console remoting server with this in the main method -
TcpChannel MyTcpChannel = new TcpChannel(9932);
ChannelServices.RegisterChannel(MyTcpChannel);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(DataLayer)
,"DataLayer",WellKnownObjectMode.Singleton);
Console.WriteLine("Server Activated");
Console.ReadLine();
from my client side i can instantiate objects fine but i would like this server console app to display something as things happen - at the moment it just stops at "Server Activated" and then never says anything again. Is it possible to do this and if so how??
Im new to remoting so please excuse me if this question sounds ignorant or stupid.
|
|
|
|
|
Its easy if what I've understood is what u are trying. All console outputs must be implemented in the romote object, not the server. The remote object lives in the server side, so anytime one of its methods is called from the client side, the console output will show on the host side.
Hope this is what u were looking for.
|
|
|
|
|
I have a problem, I want to have a base class with child inherited classes.
The parent class has a method named Instanciate().
BaseClass
{
Instanciate();
};
ChildClass
{
ContainedClass MyClass
}
In the child class I want to call instanciate to instanciate an object of ContainedClass MyClass.
I would like the code to be generic and be in the Instanciate method of the parent class so I could have many child class with contained class of diferent types.
How can I do this ?
More importantly is it better just to put the code in the Child classes ?
|
|
|
|
|
Now i have two things in my mind. One is common and quite easy way to inherit class in normal way. Classical inheritance.
Eg:
<br />
using System;<br />
<br />
namespace ConsoleApplication6<br />
{<br />
class BaseCls<br />
{<br />
public BaseCls()<br />
{<br />
}<br />
public void Display()<br />
{<br />
Console.WriteLine("I am from base");<br />
}<br />
}<br />
class FirstDerivedCls:BaseCls<br />
{<br />
<br />
public BaseCls Bs;<br />
public FirstDerivedCls()<br />
{<br />
Bs = new BaseCls(); <br />
}<br />
public new void Display()<br />
{<br />
Console.WriteLine("I am from derived");<br />
<br />
}<br />
}<br />
class SecondDerivedCls:FirstDerivedCls<br />
{<br />
static void Main()<br />
{<br />
BaseCls B=new FirstDerivedCls();<br />
FirstDerivedCls F=new FirstDerivedCls();<br />
B.Display();<br />
F.Display();<br />
F.Bs.Display();<br />
}<br />
<br />
}<br />
<br />
}
Another idea is Ad-hoc or containment form of Inheritance. I already post few answers for containment or ad-hoc inheritance. I would like past the answer once again here.
<br />
using System;<br />
<br />
namespace Containment_and_Nested_Class<br />
{<br />
public class Radio<br />
{<br />
public Radio()<br />
{}<br />
public void TurnOn(bool on)<br />
{<br />
if(on)<br />
Console.WriteLine("Jamming.....ON");<br />
else<br />
Console.WriteLine("Quit Time.....");<br />
}<br />
}<br />
public class Car<br />
{<br />
private Radio theMusic;<br />
private int CurSpeed,MaxSpeed;<br />
private string PetName;<br />
bool dead;<br />
public Car()<br />
{<br />
dead=false;<br />
MaxSpeed=100;<br />
theMusic=new Radio();<br />
}<br />
public void CrankTunes(bool state)<br />
{<br />
theMusic.TurnOn(state);<br />
<br />
}<br />
public Car(string name,int max,int cur)<br />
{<br />
PetName=name;<br />
MaxSpeed=max;<br />
CurSpeed=cur;<br />
dead=false;<br />
theMusic=new Radio();<br />
}<br />
public void SpeedUp(int delta)<br />
{<br />
if(dead)<br />
Console.WriteLine(PetName+"is out of Speed");<br />
else<br />
{<br />
CurSpeed+=delta;<br />
if(CurSpeed>=MaxSpeed)<br />
{<br />
Console.WriteLine(PetName+"has over heated");<br />
dead=true;<br />
}<br />
else<br />
Console.WriteLine("\t Current Speed="+CurSpeed);<br />
}<br />
}<br />
<br />
<br />
}<br />
public class MAINCLASS<br />
{<br />
static void Main()<br />
{<br />
Car one=new Car();<br />
one.CrankTunes(true);<br />
for(int i=0;i<10;i++)<br />
one.SpeedUp(20);<br />
one.CrankTunes(false);<br />
}<br />
}<br />
}
Sreejith Nair
[ My Articles ]
|
|
|
|
|
I've understood what you mean! It's a big problem!
Thank you for your information!
Bye!
"Catalonia is not Spain"
|
|
|
|
|
Hi
I developed a interface in C#,When I compile the Code it is generating .DLL output.
Now I wand the output as .EXE, Can any one explain how to do ths.
Is it required any code changes?
Thanks in Advance
krishna
|
|
|
|
|
Do you use Visual Studio? If yes, you can change the output file type in the project properties (Project => Properties => General).
skrishnasarma wrote:
Is it required any code changes?
A .EXE must have one entry point, that means the project needs at least one class with a "Main()" method.
_________________________________
nur Idioten brauchen einen Führer
|
|
|
|
|
In addition to what Corinna said: The main() method must have the [STAThread] attribute.
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
jan larsen wrote:
The main() method must have the [STAThread] attribute.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
Oops, seems like I'm a bit too used to VS.NET.
For some reason VS.NET insists on putting that attribute on the main() method when auto generating a main class....
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
Is there any API to judge if card be inserted into the socket of a cardreader?
|
|
|
|
|
Winodws doesn't have anything like this. You would need to consult with the Software Development Kit documentation for the device your working with, IF one exists.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all,
I want to add menu items when the user clicks the icon at the task bar at the bottom of the pocket pc. But I can't find code on it. The only code I found is that it can only launch a form when the user click the icon at the task bar, but not launch a item menu just over the task icon.
So are there any reference for it ?
Thanks
|
|
|
|
|
Since your question is platform specific and has nothing to do with C# at all, you might want to ask this in the Embedded/Mobile Forum[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
how can i merge dll's into one dll?
|
|
|
|
|
You want to merge two or more unmanaged .dlls or managed ?
Sreejith Nair
[ My Articles ]
|
|
|
|
|
i want to merge managed dlls...
|
|
|
|
|
|
all of dll's that windows uses are not inthe coorect form to use with VS.Net so we have to import them but i dont know how to extract the methods,object ,etc from them.in msdn there a few of them ...
help me...
|
|
|
|
|
|
|
Hi!
I am currently working on a tfmx (amiga sound format) player in c#. At the moment it reads correctly header and sound samples, macros and patterns.
But i don't have any idea how to output the audio files. Never wrote a music player but i can't rest till i finished this job.
I would really appreciate some help.
Greetings
|
|
|
|
|
|
You could also try using the latest version of Managed DirectX.
Playing audio with that is quite simple.
Try searching the articles for examples.
Kev
|
|
|
|