Save info   Get password
Home Submit your blog Edit Account Rules RSS-Archive Contact


MAC Address via C#
2008-08-18 09:42:48
This little snippet allows you to gather the MAC Address or Physical Address from each Network Card…. //First we need to add to References > using System.Net.NetworkInformation; using System.Diagnostics; //for Debug.Writeline only. //Now here is the code to enumerate and write the -> //MAC Address of each Network Interface on your system. //This gets all the Network Interfaces in


C# Packet Sniffer
2008-08-11 14:26:51
If you are wanting to learn how to packet sniff in C# then this little bit of code will help you to extract the raw data from the packet of a specific IP Address and PORT. I will add to this example later. //You will need to pass the IPAddress to monitor (usually your network ip [...]
Read more: Packet

Send Email in C#
2008-08-07 06:56:41
//set up the email to send to and //the SMTP Server address string eml = "auser@a_server.co.uk"; string hst = "your.mail.server" //the message to email someone string emsg = "Hi, I sent you this at " + DateTime.Now.ToString(); SmtpClient sc = new SmtpClient(hst); //the MailMessage class paremeters //1st: From email 2nd: To Email //3rd: Email Subject 4th: Email Body MailMessage mm = new MailMess


Quick C# Whois
2008-08-07 06:25:26
//This snippet shows how to call a whois server //You need to add two Namespaces as below using System.Net.Sockets; //for the TcpClient using System.IO; // for streamreader //create the byte array with the ip address to be checked byte[] query = Encoding.ASCII.GetBytes("65.175.91.98" + "n"); //create a new TcpClient passing the whois server address and port TcpClient tcp = new TcpClient("whois.l
Read more: Quick

Network Interfaces in C#
2008-08-06 14:29:24
//This demonstrates how easy it is to get //The details of each Network Interface on your system. //and even how to get the bytes sent and received //in just a few lines using System.Net.NetworkInformation; private void test() { NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces (); foreach (NetworkInterface nic in nics) { Debug.WriteLine(nic.Description); Debug.WriteLine(nic.Na


Ping in C#
2008-08-06 13:51:11
Below is a very simpleĀ  ping implementation using the Asynchronous Ping class found in the System.Net.NetworkInformation Namespace. using System.Net.NetworkInformation; //This is the Asynchronous Pinger Implementation class Pinger { //First create a delegate for the ping result event public delegate void d_ping(string res); //now setup the event public event d_ping PingBack; //Now create


Feature Requests
2008-08-04 19:44:16
Please leave your feature requests here. Please Register First. I look forward to your ideas…
Read more: Requests

Email Attachments in C#
2008-08-23 08:36:10
Now this is so easy to do. First make sure you add reference as below: using System.Net.Mail Nows heres the function I have come up with private void SendAttachment(string SendFile,string MimeType, string Smtp, string ToEmail , string SenderEmail) { //create the attachment Attachment atch = new Attachment(SendFile, MimeType); //create the mail message MailMessage mm = new MailMessage(SenderEmail, T


MIME Types
2008-08-23 08:05:04
Often when you are writing internet related software you need to be aware of MIMETypes - I have collected a list below of some of the common ones - I hopw it is useful - Also if you know anymore please register and comment - I look forward to them Extension: .3dm: MIMEType: x-world/x-3dmf; Extension: .3dmf: [...]


C# FTP List Directory
2008-08-21 05:54:46
//C# 2 and FTP Connections.... //leading to the // directory to list /// Network Credentials //File and directory List public ArrayList ListFiles(Uri uri, NetworkCredential nc) { //this holds the file directory list ArrayList ar = new ArrayList(); FtpWebRequest req = (FtpWebRequest) FtpWebRequest.Create(uri); req.Credentials = nc; req.Method = WebRequestMethods.Ftp.ListDirectory ; FtpWebRes


Page 1 of 1 « < 1 > »
eXTReMe Tracker