Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Application
- {
- // This is the main entry point of the application.
- static void Main (string[] args)
- {
- // Create a request for the URL.
- WebRequest request = WebRequest.Create (
- "http://10.190.80.248/WebService/webservice.asmx/getStudentID?id=1");
- // If required by the server, set the credentials.
- request.ContentType = "application/json";
- request.Credentials = CredentialCache.DefaultCredentials;
- // Get the response.
- WebResponse response = request.GetResponse ();
- // Display the status.
- Console.WriteLine (((HttpWebResponse)response).StatusDescription);
- // Get the stream containing content returned by the server.
- Stream dataStream = response.GetResponseStream ();
- // Open the stream using a StreamReader for easy access.
- StreamReader reader = new StreamReader (dataStream);
- // Read the content.
- string responseFromServer = reader.ReadToEnd ();
- // Display the content.
- Console.WriteLine (responseFromServer);
- // Clean up the streams and the response.
- // if you want to use a different Application Delegate class from "AppDelegate"
- // you can specify it here.
- UIApplication.Main (args, null, "AppDelegate");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement