Posts

Showing posts from October, 2012

Custom Credentials in TCP Remoting using C#

Image
Having been looking at custom credentials in TCP remoting there was an issue when switching between custom credentials and using the default credentials of the current process (this is the default behaviour). The following C# code sample shows how to pass the custom credentials to the remoting object by modifying the sink properties using the following command. IDictionary Properties = ChannelServices .GetChannelSinkProperties(Current);   The issue that didn't seem clear was how do you switch back to using the default credentials...   After trying a few different methods it seems that you need to modify the IDictionary and rather than removing the credentials from the collection set them to null as seen in the example below.     /// <summary> /// Connects to the service remote using the specified settings /// </summary> /// <param name="MachineName"> The name of the remote machine to connect to </param> /// <para

C# Tabstrip control doesn't paint correctly on resize or maximize

Image
When you are using a docked or anchored Tabstrip control in visual studio you may find that it doesn't paint correctly on resize or maximize Normally... Maximized... After having added code to refresh the tabstrip on resize I found this doesn't solve the problem. The key is to perform the refresh in the SizeChanged event of the control. This will redraw the control correctly.   private void TabControl_SizeChanged( object sender, EventArgs e)   {          TabControl .Refresh();   }