Simple Async HTTP Request

by Manuel 7/24/2008 8:25:00 AM

Since .NET Framework 2.0 there is a very easy way to perform an asynchronous HTTP request and retrieve the result as a string.
The System.Net.WebClient class provides methods and events to handle this task in a very convenient way:


using System.Net; 

private void Button_Click(object sender, RoutedEventArgs e)
{
   string topic=this.SearchTextBox.Text;
   string url = "http://yourserver.com";
   WebClient client = new WebClient();
   client.DownloadStringCompleted +=
new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
   client.DownloadStringAsync(
new Uri(url));
}

void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
   if (e.Error == null)
   {
      string result = e.Result;
   }
}

Currently rated 3.0 by 2 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

C# | ASP.NET

Remote Desktop Console

by Manuel 7/24/2008 5:03:00 AM

Windows XP:

Use your_computer_name / console

Windows Vista

Use your_computer_name /admin  

To simulate Ctrl-Alt-Del press Ctrl-Alt-End. Pressing Ctrl-Alt-Del will open the Task Manager on the local machine.

Reboot and restart:
- "shutdown" to shutdown
- "shutdown -r" to reboot
- "shutdown -i" to get a GUI
- "shutdown -l" to logoff

The MS client also allows Ctrl-Alt-Break to switch between viewing the session in a window and on the full screen.

To change the port number of the remote desktop server:
The setting for the Terminal Services port lives in the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp
Open up Regedit, find this key, look for the the PortNumber value and change it to whatever you want.

To connect to a remote server with a non standard port (other than 3389):
Use the computer name, followed by a ":" and the port (e.g. www.mymachine.com:6789)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Stuff

Powered by BlogEngine.NET 1.2.0.0
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

Sign in