Binpress components2012-11-13T12:03:54-08:00Zend_Feed_Writerhttp://www.binpress.comBinpresscontact@binpress.comhttp://www.binpress.com2012-11-13T12:03:54-08:002012-11-13T12:03:54-08:00http://www.binpress.com/app/udp-web-listener/1188David Acevedonoreply@binpress.comhttp://www.binpress.comdev/profile/16411Through 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 minutes2011-08-24T17:41:20-07:002011-08-24T17:41:20-07:00http://www.binpress.com/app/easy-log-library/558jack8024noreply@binpress.comhttp://www.binpress.comdev/profile/4044EasyLog is a simple logging tool for the .Net frameworkAbout EasyLogEasyLog 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 useEasy to configureEasy to extendConfigurable at runtime without modifying the application binary. Filter the message by level1. 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();
}
}
}
2011-04-28T06:45:11-07:002011-04-28T06:45:11-07:00http://www.binpress.com/app/impersonator/320Juan Manuel Uanininoreply@binpress.comhttp://www.binpress.comdev/profile/1068The 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 codeTo 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.