Click here to Skip to main content
15,887,267 members
Home / Discussions / C#
   

C#

 
GeneralRe: File.Exists problems with mapped network drive. Pin
UweOeder29-Aug-07 20:46
professionalUweOeder29-Aug-07 20:46 
QuestionRijndael Encryption Question.. Pin
Dio2229-Aug-07 8:26
Dio2229-Aug-07 8:26 
AnswerRe: Rijndael Encryption Question.. [modified] Pin
Alaric_29-Aug-07 10:06
professionalAlaric_29-Aug-07 10:06 
AnswerRe: Rijndael Encryption Question.. Pin
xfitr229-Aug-07 16:46
xfitr229-Aug-07 16:46 
QuestionInstallation Binder / Deployment Utility Pin
Muhammad Nauman Yousuf29-Aug-07 8:14
Muhammad Nauman Yousuf29-Aug-07 8:14 
AnswerRe: Installation Binder / Deployment Utility Pin
Spacix One29-Aug-07 8:44
Spacix One29-Aug-07 8:44 
QuestionCan "custom attributes" work for private objects? Pin
cyhsu99929-Aug-07 7:00
cyhsu99929-Aug-07 7:00 
AnswerRe: Can "custom attributes" work for private objects? Pin
Pete O'Hanlon29-Aug-07 9:19
mvePete O'Hanlon29-Aug-07 9:19 
Did it find the method? I suspect that it hasn't found the method because the binding flags haven't included the BindingFlags.NonPublic flag. The following code finds a custom attribute on a private member with no problem.
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace SimpleTestApp
{
    class Program
    {
        static void Main(string[] args)
        {
            BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic;
            MethodInfo mi = typeof(Program).GetMethod("MyMethod", flags);
            Attribute[] att = (Attribute[])mi.GetCustomAttributes(typeof(MyAttribute), true);
            if (att != null)
            {
            }
        }

        [MyAttribute("Hello")]
        private void MyMethod()
        {
        }
    }


    public class MyAttribute : Attribute
    {
        private string _name;

        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }
        public MyAttribute(string name)
            : base()
        {
            _name = name;
        }
    }
}


Deja View - the feeling that you've seen this post before.

GeneralRe: Can "custom attributes" work for private objects? Pin
cyhsu99929-Aug-07 16:31
cyhsu99929-Aug-07 16:31 
QuestionStudio 2005 Standard Pin
BoneSoft29-Aug-07 6:37
BoneSoft29-Aug-07 6:37 
QuestionObtaining a HANDLE from IO.Ports.SerialPort Pin
TheIdleProgrammer29-Aug-07 5:25
TheIdleProgrammer29-Aug-07 5:25 
AnswerRe: Obtaining a HANDLE from IO.Ports.SerialPort Pin
pbraun29-Aug-07 6:09
pbraun29-Aug-07 6:09 
GeneralRe: Obtaining a HANDLE from IO.Ports.SerialPort Pin
TheIdleProgrammer29-Aug-07 6:32
TheIdleProgrammer29-Aug-07 6:32 
AnswerRe: Obtaining a HANDLE from IO.Ports.SerialPort Pin
snorkie29-Aug-07 9:31
professionalsnorkie29-Aug-07 9:31 
QuestionHow make a dll in Visual C++ to use in C#? Pin
Rui A Sousa29-Aug-07 5:19
Rui A Sousa29-Aug-07 5:19 
AnswerRe: How make a dll in Visual C++ to use in C#? Pin
led mike29-Aug-07 6:16
led mike29-Aug-07 6:16 
GeneralRe: How make a dll in Visual C++ to use in C#? Pin
Dio2229-Aug-07 8:30
Dio2229-Aug-07 8:30 
AnswerRe: How make a dll in Visual C++ to use in C#? Pin
I Believe In GOD29-Aug-07 10:51
I Believe In GOD29-Aug-07 10:51 
QuestionHow to sort a big volume of data? Pin
michal.kreslik29-Aug-07 5:08
michal.kreslik29-Aug-07 5:08 
AnswerRe: How to sort a big volume of data? Pin
snorkie29-Aug-07 8:38
professionalsnorkie29-Aug-07 8:38 
GeneralRe: How to sort a big volume of data? Pin
michal.kreslik29-Aug-07 8:53
michal.kreslik29-Aug-07 8:53 
GeneralRe: How to sort a big volume of data? Pin
snorkie29-Aug-07 9:06
professionalsnorkie29-Aug-07 9:06 
GeneralRe: How to sort a big volume of data? Pin
michal.kreslik29-Aug-07 9:36
michal.kreslik29-Aug-07 9:36 
GeneralRe: How to sort a big volume of data? Pin
Spacix One29-Aug-07 10:30
Spacix One29-Aug-07 10:30 
GeneralRe: How to sort a big volume of data? Pin
michal.kreslik29-Aug-07 19:32
michal.kreslik29-Aug-07 19:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.