| | |
helpplz
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2008
Posts: 58
Reputation:
Solved Threads: 9
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.
•
•
Join Date: Aug 2008
Posts: 1,735
Reputation:
Solved Threads: 186
that and you already asked this you act like a spammer
http://www.daniweb.com/forums/thread156668.html
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.
•
•
Join Date: Oct 2007
Posts: 172
Reputation:
Solved Threads: 16
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);
}
}
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);
}
}
![]() |
Other Threads in the C# Forum
- Previous Thread: hi uegent
- Next Thread: Version of the Assembly
| Thread Tools | Search this Thread |
.net access algorithm array asp.net barchart bitmap box broadcast buttons c# check checkbox client combobox control conversion csharp custom database databaseconnection datagrid datagridview dataset datetime dbconnection degrees design development draganddrop drawing encryption enum event eventhandlers excel file firefox form format forms function gdi+ grantorrevokepermissionthroughc#.net httpwebrequest image index input install java label libraries list listbox loop mandelbrot math mouseclick movingimage mysql mysql.data.client operator path photoshop picturebox pixelinversion platform post programming radians regex remote remoting resourcefile richtextbox server sleep socket sql statistics stream string system.servicemodel table tcpclientchannel text textbox thread time timer update usercontrol validation visualstudio webbrowser windows winforms wpf wpfc# xml






