Posts

Showing posts from 2012

Localized type conversion

If you need a DateTime or double convertion depending on system localization here are some examples: Date to string DateTime dt = new DateTime(2012, 06, 13, 17, 50, 00); string date_US = dt.ToString(new CultureInfo("en-US").DateTimeFormat); string date_GB = dt.ToString(new CultureInfo("en-GB").DateTimeFormat); string date_PL = dt.ToString(new CultureInfo("pl-PL").DateTimeFormat); string date_RU = dt.ToString(new CultureInfo("ru-RU").DateTimeFormat); Console.WriteLine("date_US = {0}", date_US); Console.WriteLine("date_GB = {0}", date_GB); Console.WriteLine("date_PL = {0}", date_PL); Console.WriteLine("date_RU = {0}", date_RU); /* date_US = 6/13/2012 5:50:00 PM date_GB = 13/06/2012 17:50:00 date_PL = 2012-06-13 17:50:00 date_RU = 13.06.2012 17:50:00 */ String to date date_US = "6/13/2012 5:50:00 PM"; date_GB = "13/06/2012 17:50:00"; date_PL = "2012-06-13 17:50:00"; d...

SSH

Recently I was thinking of SSH support in my TCExecutor application. I've found some 3rd party libraries which support SSH.... but... I think I'll try to implement it on my own... Here are some specs: The Secure Shell (SSH) Protocol Assigned Numbers - RFC 4250 The Secure Shell (SSH) Protocol Architecture - RFC 4251 The Secure Shell (SSH) Authentication Protocol - RFC 4252 The Secure Shell (SSH) Transport Layer Protocol - RFC 4253 The Secure Shell (SSH) Connection Protocol - RFC 4254

TCExecutor v0.0.1 released

Image
TCExecutor - Telnet Command Executor C# open source project is released in version 0.0.1 Thanks to TCExecutor you can add communication/configuration layer to your application in just four steps: Create TCExecutor object Define commands Hook up your code to commands events (TCExecutor is multithread/multiconection application remeber that your code must be threadsafe) Start TCExecutor listener. Commands style: > command1  subcommand1 ... subcommandN param1=X1 ... paramN=XN  ARGV1...ARGVN Features: Adds network communication layer to your application Supports multiple connections. For each connection separate session is established. Commands can be defined at your application startup. Each command has separate event to which you can connect to. Each command has a short and long help string which helps end user to navigate through available options. Next releases features: Enable SSH connections to the TCExecutor. Add simple user autentication...