a blog about Development and Tech stuff by Kristian S. Ravndal RSS 2.0
# Tuesday, July 22, 2008

Often it is very useful to have a console besides the winform/wpf application. And its really easy to :)
Create an available class:

using System;
using System.Runtime.InteropServices;

public static class ConsoleEx
{

/// <summary>
///
Shows the Console
///
</summary>
[DllImport("kernel32.dll")]
public static extern Boolean AllocConsole();

/// <summary>
///
Hides the Console
///
</summary>
[DllImport("kernel32.dll")]
public static extern Boolean FreeConsole();

}


I then use it like this in my Code (WPF App):
public partial class App : Application
{

public App(){

#if DEBUG
ConsoleEx.AllocConsole();
#endif

}

}

You could use this with a Linq DataContext:

MyDataContext.Log = Console.Out;

Tuesday, July 22, 2008 12:49:06 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
Tips&Tricks
# Friday, July 18, 2008

While we were down in Paris on Imagine Cup, we encountered a big problem. Our server was running live in Oslo (Norway), and the internet connection was too slow to actually load the pages we needed. But it did however; work well in remote desktop as it takes lower bandwidth than a whole website with all the images. Imagine Cup had a firewall blocking just about everything about standard web ports (80,433), so we had to change the default port for Remote Desktop.  

In order to change the Remote Desktops default listening port, you actually need to do a little registry hack.

Open regedit, and navigate to

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber

On the Edit menu, click Modify, and select Decimal (unless you prefer the hex values)

Now, restart “Terminal Services”, and it should be up and running on the new port.

We switched the port to 443, and everything worked like a charm. A special thanks to Rune Zakariassen for lending us the 3G connection to fix it all.

Friday, July 18, 2008 12:46:33 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
Tips&Tricks
Navigation
Archive
<July 2008>
SunMonTueWedThuFriSat
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789
Other blogs
About the author/Disclaimer

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

© Copyright 2010
Kristian Sølve Ravndal
Sign In
Statistics
Total Posts: 5
This Year: 0
This Month: 0
This Week: 0
Comments: 3
Themes
All Content © 2010, Kristian Sølve Ravndal
DasBlog theme 'Business' created by Christoph De Baene (delarou)