helpplz

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2008
Posts: 128
Reputation: sivak has a little shameless behaviour in the past 
Solved Threads: 0
sivak sivak is offline Offline
Junior Poster

helpplz

 
0
  #1
Nov 11th, 2008
when we go for webservices in .net webapplications? example plz?
2.what is mean by delegate and asynchronous delegate in .net
3.static method with example?plz
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 58
Reputation: vckicks is an unknown quantity at this point 
Solved Threads: 9
vckicks vckicks is offline Offline
Junior Poster in Training

Re: helpplz

 
0
  #2
Nov 12th, 2008
I don't mean to give a useless answer but a simple Google search of all the above questions gives immediate and rich answers...
Visual C# Kicks - Free C# code resources and articles.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: helpplz

 
0
  #3
Nov 12th, 2008
that and you already asked this you act like a spammer

http://www.daniweb.com/forums/thread156668.html
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 172
Reputation: Jugortha is an unknown quantity at this point 
Solved Threads: 16
Jugortha Jugortha is offline Offline
Junior Poster

Re: helpplz

 
0
  #4
Nov 12th, 2008
when we go for webservices in .net webapplications? example plz?
2.what is mean by delegate and asynchronous delegate in .net
3.static method with example?plz

A web service is used like any other applications that provide services like dll for example it could hold a set of web methods those serves to make calculs or so. you can add them into your application you just go to the solution explorer right click on your project then click add web reference then follow the instructions to add your webservice
To instanciate it you just type it name it will appear in the intellisense for example if the web service is on the localhost server
LocalHost.ServiceName x = new LocalHost.ServiceName();

a delegate is a sort of method pointer, you can use it when you have more than one method but you want to chose when use each one

try this code for example

using System;

public delegate string DelegateDescription();

public class Person
{
private string name;
private int age;

public Person(string name, int age)
{
this.name = name;
this.age = age;
}

public string NameAndAge()
{
return(name + " is " + age + " years old");
}

}

public class Employee
{
private string name;
private int number;
public Employee(string name, int number)
{
this.name = name;
this.number = number;
}

public string MakeAndNumber()
{
return(name + " is " + number + " mph");
}
}

class MainClass
{
public static void Main()
{
Person myPerson = new Person("Price", 32);
DelegateDescription myDelegateDescription = new DelegateDescription(myPerson.NameAndAge);

string personDescription = myDelegateDescription();
Console.WriteLine("personDescription = " + personDescription);

Employee myEmployee = new Employee("M", 140);

myDelegateDescription = new DelegateDescription(myEmployee.MakeAndNumber);

string d = myDelegateDescription();
Console.WriteLine(d);
}
}


Asynchrone delegate are used when asunchrone calls are needed

Try this code

using System;


public class AsynchronousCallsASimpleExample
{
public static void Main()
{
AsyncCaller ac = new AsyncCaller();
ac.CallWriteLine("Hello");
}
}

public class AsyncCaller
{
// Declare a delegate that will match Console.WriteLine("string");
delegate void FuncToCall(string s);

public void CallWriteLine(string s)
{
// delegate points to function to call
// start the async call
// wait for completion
FuncToCall func = new FuncToCall(Console.WriteLine);
IAsyncResult iar = func.BeginInvoke(s, null, null);
func.EndInvoke(iar);
}
}
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C# Forum
Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC