|
Literal "ABC" IS instance of type string.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Hi,
Even your question is not very clear
Let me explain you the difference between the predefined and user defined data types.
See if "AA" is a user defined class, while creating an instance of the classs AA, "new" operator must be used. i.e.
AA a = new AA();
Only, after this we can set/get the non-static members.
In case of predfined types like "string", the C# compiler knows of them advance, hence uses "new" operator internally. i.e.
In case of
string str = "ABC";
C# compiler knows about string class, hence does str = new string("ABC") internally.
Manoj
|
|
|
|
|
|
Thanks for such short and sweet answer..nw i understood.
|
|
|
|
|
The only special about strings, is that you can write string literals in the code. When the code is compiled, the string literals are created as constant string objects.
So, this code:
string str = "ABC";
works more like this:
const string strconst001 = "ABC";
string str = strconst001;
So, when you assign a string literal, you don't really create a string object, you only assign the reference of a string object that already exists.
When you actually create a new string object, it works like any other class. Example:
string str = new String('*', 42);
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi
Im designing a touch screen windows application where i have customized the buttons to hold images for all states like (enabled, disabled, clicked, mouse over). Same i have done for panels. But some times the images are not displaying correctly instead of image it is displaying Big X mark in red color. (like in the internet explorer if the image is not present it will diaply one X mark right)
Why did this happend, I have not seen this regularly, this is happened rarely..
I am thinking it should be a memory issue.. or GUI is not refreshing properly?
Even i have used double buffering..
One more question Is there anyway to get notificaiton (like events) in the code if the user kills the application from task manager? Becuase sometimes application is not opening if we kill the application using taskmanager and reopen.
Any help?
|
|
|
|
|
I ran into the same problem once. My drawing code was taking entirely too long to update the screen image before it was called again.
|
|
|
|
|
engsrini wrote: Is there anyway to get notificaiton (like events) in the code if the user kills the application from task manager? Becuase sometimes application is not opening if we kill the application using taskmanager and reopen.
Nope. If the application is killed, or forcibly stopped, you'll never get an event because your code stops executing and the memory it occupies is freed. If youre code isn't running any more, there's no way it can respond to being killed off.
|
|
|
|
|
I am working in .NETt tech. Like Asp.Net,VB.NET.
I want to know that What is the major drawback of C#.NET.
Param
|
|
|
|
|
The major drawback is probably that anyone can read your code. This is also true of VB.NET, but VB has other drawbacks that C# does not
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
How do you say that any one can read the code. How come this is possible.This is not open source rite. Please give me some proof.
Regards,
A Jabeer Ali
|
|
|
|
|
.NET Intermediate compiled language(IL) is very easy to decompile.
|
|
|
|
|
Compile up your application as Release mode so that you know that you can't cheat by retrieving debug symbols. Then, attempt to open it up using Lutz Roeder's Reflector[^] - there you go, you're back at the code you started with (almost).
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: you're back at the code you started with (almost).
often better written in my experience. The compiler optimisations seem to work
I've also seen people use this to convert VB to c#.
Russell
|
|
|
|
|
Yeah, reflection is at the core of all .NET language converters, I believe.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
how can i convert my C# Code to VB.Nets?<br />
i mean how to decompile / any other process?<br />
thnx in advance <br />
prashanth
I received this by direct email.
The trick that i've seen used is to compile the code and then use reflector to decompile it. I know someone who uses this to convert code examples that he finds on the web from vb.net to c#. He also did vb6 to c# using the VB upgrade wizard and reflector. I'm pretty sure that reflector allows you to decompile to vb.
Russell
|
|
|
|
|
LOL - another person comes to terms with the hard reality. .NET is compiled to an intermediate language, which is compiled by the frame work to run, and easily decompiled to read, using tools such as reflector.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
That's not a drawback of the language itself.
What I like least about C# is... it doesn't break from C far enough in some cases:
I like that switch statements don't fall through, that's great, but I don't like that the break statement is required, I understand why the decision was made this way, but I don't like it. I would rather that break only applied to loops... have you ever tried to break a loop from within a switch ?
|
|
|
|
|
Parameswar Mal wrote: I want to know that What is the major drawback of C#.NET.
you will not like any other technology as maximum things are readily available.
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Did any one take the Source code from the Client Side. Is that possible in c#.net.
Regards,
A Jabeer Ali
|
|
|
|
|
|
I have two machines. From Machine A to Machine B, i have sent a message using Http Format, if the Queue is full in Machine B, i am not getting any acknowledgement to Admin queue.
Please provide valuable suggestions to me. i have sturck up here.
Thanks in advance
Bala
|
|
|
|
|
Hi
I am using a custom Validator for a text box and I want to fire that validation when value given in the text box fetches any any value from the database.
I am doing select operation with value given in the text box.If it return any records then the validation should fire.
I'm using C#
Thank U
Chandu
|
|
|
|
|
You could call the validator on the TextChanged event handler of your textbox and clear the text if it doesn't fulfill your conditions.
The more I see of men, the better I like my dog. Blaise Pascal.
|
|
|
|
|
Hi All,
I have created a Dll File using Visual C++. I want to use it in C# project. Can anyone please tell me how to do that.
Thanks in advance.
Anurag Gandhi.
|
|
|
|