C#
|
|
 |

|
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid..
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|

|
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|

|
hi,
is there a way that i can get the attributes in my class dynamically like calling a function which return all the attributes in my class in an list/array?
however, without hard-coding so that even when my class attributes changes i dont need to change this function
|
|
|
|

|
Try:
Type type = typeof(MyClass);
object[] oat = type.GetCustomAttributes(true);
foreach (object at in oat)
{
Console.WriteLine("{0}", at.ToString());
}
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|

|
Hi,
Please let me know how may I store follow string value into string variable ?
string myValue = "aa[a"a]aa";
Thank you in advance
|
|
|
|

|
use a backslash to escape the quote
string myValue = "aa[a\"a]aa";
|
|
|
|

|
string d = "this is a open quote \" and this is a \" close Quote";
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|

|
To add to what Davey and Simon have said, '\' is an "escape" character, which tells the compiler that the following character is a special, rather than a standard character. A '\' followed by double quote is a double quote character rather than the end of the string, and other sequences have different meaning, such as \\ for a '\' character, \n for a newline and \t for a tab. You can also use:
string myValue = @"aa[a""a]aa"; The '@' turns off recognition of the '\' as a special, allowing you to type a single '\' character if you are entering a path:
string mypath = "D:\\Temp\\myfile.txt";
Or
string mypath = @"D:\Temp\myfile.txt"; When you use a '@' prefix, you use tqo double quote characters together to insert a single double quote character in the string.
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|

|
hi
does anyone know how i can create a general log eg if i had classes
student: id,name,age
and
teacher: id, name, nation
as you can see the 2 class differs
is it possible to create a table which can save each changes i make like a log?
so that i can see the changes i made.
|
|
|
|

|
Where do you want to save the information and in what format? If you just want general logging of transactions then take a look at log4net Tutorial[^].
Use the best guess
|
|
|
|
 |
|
|
General
News
Suggestion
Question
Bug
Answer
Joke
Rant
Admin