Click here to Skip to main content
15,898,747 members
Home / Discussions / C#
   

C#

 
AnswerRe: SEARCH ENGINE Pin
Nouman Bhatti24-Oct-07 23:28
Nouman Bhatti24-Oct-07 23:28 
AnswerRe: SEARCH ENGINE Pin
Paul Conrad27-Oct-07 12:33
professionalPaul Conrad27-Oct-07 12:33 
QuestionHow to sign a digital certificate..? Pin
Pankaj - Joshi24-Oct-07 20:44
Pankaj - Joshi24-Oct-07 20:44 
QuestionFileSystemWatcher class- reason ?? Pin
Hum Dum24-Oct-07 20:34
Hum Dum24-Oct-07 20:34 
AnswerRe: FileSystemWatcher class- reason ?? Pin
leppie24-Oct-07 21:13
leppie24-Oct-07 21:13 
QuestionRegarding code for decimal to ASCII Pin
praveenkumar palla24-Oct-07 20:21
praveenkumar palla24-Oct-07 20:21 
AnswerRe: Regarding code for decimal to ASCII Pin
Mohib Sheth24-Oct-07 20:26
Mohib Sheth24-Oct-07 20:26 
GeneralRe: Regarding code for decimal to ASCII Pin
praveenkumar palla24-Oct-07 20:49
praveenkumar palla24-Oct-07 20:49 
AnswerRe: Regarding code for decimal to ASCII Pin
PandemoniumPasha24-Oct-07 20:27
PandemoniumPasha24-Oct-07 20:27 
GeneralRe: Regarding code for decimal to ASCII Pin
praveenkumar palla24-Oct-07 20:49
praveenkumar palla24-Oct-07 20:49 
QuestionProtect DLL Pin
Mohib Sheth24-Oct-07 20:20
Mohib Sheth24-Oct-07 20:20 
AnswerRe: Protect DLL Pin
N a v a n e e t h24-Oct-07 20:51
N a v a n e e t h24-Oct-07 20:51 
GeneralRe: Protect DLL Pin
Mohib Sheth24-Oct-07 21:04
Mohib Sheth24-Oct-07 21:04 
GeneralRe: Protect DLL Pin
leppie24-Oct-07 21:12
leppie24-Oct-07 21:12 
AnswerRe: Protect DLL Pin
Mohib Sheth24-Oct-07 21:20
Mohib Sheth24-Oct-07 21:20 
GeneralRe: Protect DLL Pin
N a v a n e e t h24-Oct-07 21:27
N a v a n e e t h24-Oct-07 21:27 
GeneralRe: Protect DLL Pin
Mohib Sheth24-Oct-07 21:39
Mohib Sheth24-Oct-07 21:39 
QuestionCustom page setting in crystal report Pin
Sunil K Prajapati24-Oct-07 19:37
Sunil K Prajapati24-Oct-07 19:37 
QuestionWriting the content of a DataTable into XML string Pin
M.A.Burhan24-Oct-07 19:24
M.A.Burhan24-Oct-07 19:24 
Questioncomparison with delegates [modified] Pin
kabutar24-Oct-07 19:17
kabutar24-Oct-07 19:17 
hi,
i have two set of codes here for the same output....
one is by using the functions that i wrote and the other one is by using delegates(got form net)

can anybody tell me the advantage of using the delegates in this code??
please check the comments in the code using delegates...
i found the normal way much easier....

WITHOUT USING DELEGATES:::

using System;
using System.Collections.Generic;
using System.Text;

namespace trialfunctions
{
class Program
{
string name;
public void enter()
{
Console.WriteLine("enter a string");

}
public void display()
{
name = (Console.ReadLine()).ToString();
Console.WriteLine("The string entered is {0}", name);
Console.ReadLine();
}
static void Main(string[] args)
{
Program obj = new Program();
obj.enter();
obj.display();
}
}
}
----------------------------------------------------------
///////////////////////////////////////////////////////////
----------------------------------------------------------
USING DELEGATES:::::

using System;
public delegate void TestDelegate(string message); //Declare the delegate
class Test
{
public static void Display(string message)
{
Console.WriteLine("The string entered is {0} " , message);
}
static void Main()
{
TestDelegate t = new TestDelegate(Display); //Instantiate the delegate
Console.WriteLine("Please enter a string");
string message = Console.ReadLine(); //what is the need for this
t(message); //Invoke the delegate
Console.ReadLine();
}
}
thanking you



-- modified at 1:45 Thursday 25th October, 2007

C#

AnswerRe: comparison with delegates Pin
Christian Graus24-Oct-07 20:58
protectorChristian Graus24-Oct-07 20:58 
GeneralRe: comparison with delegates Pin
N a v a n e e t h24-Oct-07 21:06
N a v a n e e t h24-Oct-07 21:06 
GeneralRe: comparison with delegates Pin
kabutar24-Oct-07 21:08
kabutar24-Oct-07 21:08 
Questionkey up problem in template column of data grid Pin
veereshIndia24-Oct-07 19:13
veereshIndia24-Oct-07 19:13 
QuestionCryptoStream Pin
El Fenomeno24-Oct-07 19:00
El Fenomeno24-Oct-07 19:00 

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.