November 23, 2005
Using C# Xml Documentation
Heres some links:
MSDN Article on Using Xml Within C#
Xml Documentation Tutorial
Recommended Tags for Documentation Comments
November 21, 2005
Modifying Config File for a Log4Net TraceAppender
Modifying an App.Config file for Log4Net
Adding a TraceAppender:
<appender name="TraceAppender" type="log4net.Appender.TraceAppender"> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%date{HH:mm:ss,fff}[%thread] %-5level %logger{2}: %message%newline%exception" /> </layout> </appender>Setting a module to use the log to the TraceAppender and the ConsoleAppender
<logger name="mymodule.comms"> <level value="ALL" /> <appender-ref ref="ConsoleAppender" /> <appender-ref ref="TraceAppender" /> </logger>
Helper Class To Converts Strings To Ascii and Back
using System.Text; ... // Helper methods for converting strings to ascii and back public class Ascii { // Converts a standard c# unicode string to an array of ASCII characters public static byte[] FromString(string str) { Encoding ascii = Encoding.ASCII; byte[] asciiBytes = ascii.GetBytes(str); return asciiBytes; } // Converts an array of ASCII characters to a standard c# unicode string public static string ToString(byte[] asciiString) { // Create two different encodings. Encoding ascii = Encoding.ASCII; string str = ascii.GetString(asciiString); return str; } }
Using Streams To Serialize Something to A Byte Array
Writing To A Stream Using A BinaryWriter
byte[] data; MemoryStream stream = new MemoryStream(); BitWriter writer = new BitWriter(stream, System.Text.Encoding.ASCII); writer.UseNetworkByteOrder = true; bat.Serialize(writer); stream.Flush(); stream.Close(); data = stream.ToArray(); return data;
TCP/IP Socket Programming in C#
Here is some links I discovered during my research:
- Using Sockets in C#
- Portscanning in C# Using Sockets
- Good intro to TcpClient and TcpListener
- MSDN C++ to c# article - Has some basic Tcp and use of Socket type code
- MSDN article on sockets
- Handling Socket Exceptions
Subscribe to:
Posts (Atom)