TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
saravanamurugan m
NA
3
0
C# : Unable to Refer a Method of a Class using Delegate
Mar 1 2010 12:47 AM
Hai Friends,
I am working with Asp.net C#. Here i got a problem with Delegate. I can't able to Refer a method (which is defined in a class) by the class object. Here is my code, Please take a look at it...
Program Code:
using System;
namespace consoleApp {
class baseClass
{
public delegate void delgFun();
public class P
{
public static void Hellow()
{
Console.WriteLine("Hellow World...");
}
public static void Hai()
{
Console.WriteLine("Hai...");
}
}
public static void Main(String[] args)
{
delgFun delgFunObj1 = P.Hellow;
P objP = new P();
delgFun delgFunObj2 = objP.Hai;
//here comes problem
delgFunObj1();
delgFunObj2();
}
}
}
Please Fix it.
Advanced thanks
Saraharisan. M
Reply
Answers (
3
)
Lesson 6, Is support for ODBC being discontinued by Microsoft.
how can i related with sensor SUPREMA madule serial port?