Binpress components 2012-11-13T12:03:54-08:00 Zend_Feed_Writer http://www.binpress.com Binpress contact@binpress.com http://www.binpress.com <![CDATA[UDP Web listener - C# | ASP.NET]]> 2012-11-13T12:03:54-08:00 2012-11-13T12:03:54-08:00 http://www.binpress.com/app/udp-web-listener/1188 David Acevedo noreply@binpress.com http://www.binpress.comdev/profile/16411 Through the Web listener you can obtain and to send UDP data packets from one or more devices simultaneousWeb Listener Library Through the Web listener you can obtain and to send UDP data packets from one or more devices simultaneously. The Web listener can run in the background, allowing your web application can operate without problems while receiving data from a GPS device. Solve the problem to enable a Web Listener in asp.net technology to receive and send packets from the Web and in the background. Was tested on .Net framework 3.5 and 4.0, using VS2008 and VS2010. For testing were used 2 GPS LANTRIX T1800. The devices transmit data every 3 minutes <![CDATA[Easy Log Library - C#]]> 2011-08-24T17:41:20-07:00 2011-08-24T17:41:20-07:00 http://www.binpress.com/app/easy-log-library/558 jack8024 noreply@binpress.com http://www.binpress.comdev/profile/4044 EasyLog is a simple logging tool for the .Net frameworkAbout EasyLog EasyLog is a simple logging tool for for the .Net framework, and is designed to be easy to use, easy to configure and easy to extend. Feature: Easy to use Easy to configure Easy to extend Configurable at runtime without modifying the application binary. Filter the message by level 1. Easy to Use Code just like : Log.Debug("Debug Message"); //write a debug level message Log.Error("Error Message"); //write a error level message Log.Error("Error Message", ex); //write a error level message and log the exception Log.LogMessage("Error Message", Level.Error); //write a message with specipfy level Log.LogMessage("Fatal Message", Level.Fatal, ex);//write a message with specipfy level and log the 2. Easy to Configurate Default it is not need to configurate. The default configuration is: EasyLog.LogLevel is Error. EasyLog.LogType is EasyLog.FileLog type. EasyLog.FileLog.FilePathFormat is "~/log/{0:yyyy-MM-dd}.log", it will generate one log file per day. EasyLog.FileLog.MaxLogLength is 10M, it will limit the content length to 10M. It is suitable for deployment. Below is equal configuration in application configuration file <appSettings> <!--LogLevel: All, Debug, Info, Warn, Error, Fatal, Off --> <add key="EasyLog.LogLevel" value="Error"/> <!--LogType: the type of the loger, default is EasyLog.FileLog, like 'Namespace.ClassName, AssemblyName' --> <add key="EasyLog.LogType" value="EasyLog.FileLog, EasyLog"/> <!--FileLog.FilePathFormat: default format is ~/log/{0:yyyy-MM-dd}.log --> <add key="EasyLog.FileLog.FilePathFormat" value="~/log/{0:yyyy-MM-dd}.log"/> <!--FileLog.MaxLogLength: max file content length, default is 10M --> <add key="EasyLog.FileLog.MaxLogLength" value="10M"/> </appSettings> 3. Easy to Extend See How to Extend it? 4. Configurable at runtime without modifying the application binary. it use appSettings to store configuration in application configuration file. it is optional, you can change it. 5. Filter the message by level level: DEBUG < INFO < WARN < ERROR < FATAL Default level is error, it will filter debug, info and warn level message. 6. How to Extend it? it is easy to extend it, add a class that implemented the interface ILog, and configure it in the appSettings just like <add key="EasyLog.LogType" value="EasyLogTest.ConsoleLog, EasyLogTest"/> Example usage: using EasyLog; using System.Collections.Specialized; namespace EasyLogTest { public class ConsoleLog : ILog { public void ConfigLogger(NameValueCollection properties) { } public void LogMessage(object message, Level level, Exception ex) { StringBuilder messageBuilder = new StringBuilder(); FormatMessage(messageBuilder, message, level, ex); Console.Write(messageBuilder); } public void FormatMessage(StringBuilder builder, object message, Level level, Exception e) { builder.Append("\tConsoleLog "); builder.Append(DateTime.Now); builder.Append((" [" + level.ToString().ToUpper() + "] ").PadRight(9)); builder.Append(message); if (e != null) { builder.Append(Environment.NewLine).Append(e.ToString()); } builder.AppendLine(); } } } <![CDATA[Impersonator - C#]]> 2011-04-28T06:45:11-07:00 2011-04-28T06:45:11-07:00 http://www.binpress.com/app/impersonator/320 Juan Manuel Uanini noreply@binpress.com http://www.binpress.comdev/profile/1068 The term "Impersonation" in a programming context refers to a technique that executes the code under another user context than the user who originally started an application, i.e. the user context is temporarily changed once or multiple times during the execution of an application.The term "Impersonation" in a programming context refers to a technique that executes the code under another user context than the user who originally started an application, i.e. the user context is temporarily changed once or multiple times during the execution of an application. The reason for doing this is to perform tasks that the current user context of an application is not allowed to do. Of course you could grant the user executing an application more privileges, but usually this is a bad idea (due to security constraints) or impossible (e.g. if you don't have full administrative access to a machine to do so). Using the code To use the code, you simply construct the Impersonator class and pass the username, the domain and the password to the constructor. If you place an instance of the class inside a using-block, you need no further steps. The following is a schematic example of how to use the class: using ( new Impersonator( "myUsername", "myDomainname", "myPassword" ) ) { ... <code that executes under the new context> ... } To include the Impersonator class into your project, simply copy and add the source file "Impersonator.cs" to your project, so that it gets compiled with your project.