Archive for July, 2008

Get URL Response

Friday, July 18th, 2008 Posted in .NET/C# | Comments Off

public string GetSiteContents(string url) { StringBuilder sb = new StringBuilder(); byte[] buf = new byte[8192]; HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url); HttpWebResponse response = (HttpWebResponse) request.GetResponse(); Stream resStream = response.GetResponseStream(); string tempString = null; int count ... Read more..

Cookies

Friday, July 18th, 2008 Posted in .NET/C# | Comments Off

private void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { if (Request.Cookies["MuneebCookies"]!=null) { HttpCookie httpCookie = Request.Cookies["MuneebCookies"]; TextBox1.Text = httpCookie["FirstName"]; TextBox2.Text = httpCookie["LastName"]; } } } private void Button1_Click(object sender, System.EventArgs e) { HttpCookie httpCookie = new HttpCookie("MuneebCookies"); httpCookie.Values.Add("FirstName", TextBox1.Text); httpCookie.Values.Add("LastName", TextBox2.Text); httpCookie.Expires = DateTime.Now.AddHours(2); // ... Read more..

SMTP Mail

Friday, July 18th, 2008 Posted in .NET/C# | Comments Off

using System; using System.Web.Mail; namespace ConsoleApplication1 { class Class1 { [STAThread] static void Main(string[] args) { MailMessage Message = new MailMessage(); Message.To = "to_address@domain.com"; Message.From = "from_address@domain.com"; Message.Subject = "test1"; Message.Body = "test1"; try { Message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1); Message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "muneebsa"); Message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "you03ahm"); Message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", 2); Message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", "smtp.sbcglobal.yahoo.com"); Message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout", ... Read more..

Simple Database Access

Friday, July 18th, 2008 Posted in .NET/C# | Comments Off

string connectionString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=test;USER=root;PASSWORD=mypassword;OPTION=3;"; IDbConnection conn = new OdbcConnection(connectionString); conn.Open(); IDbCommand command = new OdbcCommand("select UserID, FirstName from Users"); command.Connection = conn; IDataReader reader = command.ExecuteReader(); while (reader.Read()) { string userID = (string) reader["UserID"]; string firstName ... Read more..

Send Email using SmartMail

Friday, July 18th, 2008 Posted in ASP | Comments Off

Read more..

Send Mail using JMail

Friday, July 18th, 2008 Posted in ASP | Comments Off

Read more..

Display Files in a Folder

Friday, July 18th, 2008 Posted in ASP | Comments Off

Document List Read more..

Read File Contents

Friday, July 18th, 2008 Posted in ASP | Comments Off

Read more..

Server Variables

Friday, July 18th, 2008 Posted in ASP | Comments Off

Read more..

How to setup Internet Radio Broadcast

Wednesday, July 9th, 2008 Posted in Solutions | Comments Off

(1) Sign up with some Media Broadcasting Server company. Below is list of companies I know: http://www.shoutcast.com http://www.spacialnet.com http://www.streamguys.com http://shoutcast.serverroom.us/ http://www.tigerdirect.com/ Typical Streaming Cost 0.6 dollars per subscriber per month @ 32kb/s 1.15 dollars per subscriber ... Read more..