goodmorningsky Posted October 28, 2003 Posted October 28, 2003 [system.Diagnostics.DebuggerStepThroughtAttributes()] public EchoServer(){ ... } [WebMethod] public string Echo(string ms){ } [sTAThread] static void main(){ } What are those [] block? I know it's called attribute.. But, I haven't find any article about it.. I need to know syntax, architecture of it.. I haven't seen those from VB, Java...or other language.. Please reply with explanation or any source links.. Thank you all Quote Sun Certified Web component Developer, Microsoft Certified Solution Developer .NET, Software Engineer
*Experts* Bucky Posted October 28, 2003 *Experts* Posted October 28, 2003 [mshelp=ms-help://MS.MSDNQTR.2003FEB.1033/csref/html/vclrfIntroductionToAttributes.htm]Here we go[/mshelp]. In VB.NET, attributes are put inside < and > characters. There is also a typo in your first sub, EchoServer; it should be System.Diagnostics.DebuggerStepThroughAttribute() Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
*Experts* Nerseus Posted October 28, 2003 *Experts* Posted October 28, 2003 The attributes (also called decorations as in, "decorate the method EchoServer with the DebuggerStepThroughAttribute attribute") are extra info for the compiler. There are a bunch of them and you use them for a variety of reasons. For instance, "[WebMethod]" marks a method as a webservice so that the compiler can generate the proper code. You can add simple attributes like Description to describe a property: [Description("The Min value")] public int MinValue { // property code would go here... } Assuming the above were part of a user control, the "Description" attribute lets the Property window (in design time) show the description. If you have any attributes particular you have questions about, ask away :) -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
wyrd Posted October 28, 2003 Posted October 28, 2003 http://www.codeproject.com/csharp/attributes.asp Quote Gamer extraordinaire. Programmer wannabe.
goodmorningsky Posted October 29, 2003 Author Posted October 29, 2003 Thank you . now I got little clue for that. It's very strange that I never found former document or book describing about this out of more than 20 .net books and various articles.. Quote Sun Certified Web component Developer, Microsoft Certified Solution Developer .NET, Software Engineer
*Experts* Nerseus Posted October 29, 2003 *Experts* Posted October 29, 2003 Other than [WebMethod], you normally won't encounter attributes in many beginner books/tutorials. Not that they're advanced features by any stretch, it's just that there's so much to learn about .NET that they often get overlooked. -ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
goodmorningsky Posted October 31, 2003 Author Posted October 31, 2003 That's true.. As more I learn .net, I face more deep and wide concepts of Computer science. There are nothing to throw out from what I learn from school; network, security, grammer, oop, Soft engineering, graphic, math, algorithms....... If anyone study computer science now, never look down what you are learning from class room!!! Even though you don't feel it's necessary, those will be stable corner stone for your life span compurter science career.. Quote Sun Certified Web component Developer, Microsoft Certified Solution Developer .NET, Software Engineer
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.