reset and begin
Showing posts with label C#. Show all posts

4/25/2010

lấy giá vàng bóc tách nội dung C#

sử dụng C# để bóc tách nội dung của 1 trang xml
string urdl = "http://www.vietcombank.com.vn/ExchangeRates/ExrateXML.aspx";
int i = 0;
XmlTextReader MyReader = new XmlTextReader(urdl);
while (MyReader.Read())
{
if (MyReader.Name == "Exrate")
{
Response.Write(MyReader.GetAttribute(0).ToString());
Response.Write("
");
}

}

7/16/2009

send mail window C#

MailMessage MailMesaji = new MailMessage();

MailMesaji.Subject = "subject";

MailMesaji.Body = "mail body";

MailMesaji.BodyEncoding = Encoding.GetEncoding("Windows-1254"); //Encoding

MailMesaji.From = new MailAddress("shimi.gov@gmail.com");

MailMesaji.To.Add(new MailAddress("shimi.gov@gmail.com"));

System.Net.Mail.SmtpClient Smtp = new SmtpClient();

Smtp.Host = "smtp.gmail.com"; // for example gmail smtp server

Smtp.EnableSsl = true;

Smtp.Credentials = new System.Net.NetworkCredential("shimi.gov@gmail.com", "password");

Smtp.Send(MailMesaji);
Form1.ActiveForm.Text = "thanh cong";

7/15/2009

using proxy with com webbrower C#

public void strproxy(string serverName,string port)
{
string key = "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings";
string proxy = serverName + ":" + port;
RegistryKey RegKey = Registry.CurrentUser.OpenSubKey(key, true);
RegKey.SetValue("ProxyServer", proxy);
RegKey.SetValue("ProxyEnable", 1);
}
button click
string strurl = "http://shimivn.blogspot.com";
webBrowser1.Url =new System.Uri(strurl);
webBrowser1.Document.Cookie = null;
webBrowser1.GoForward
// webBrowser1.Show();

7/14/2009

random in asp.net/c#

using sql querry :
string sqlqueryselect = "select top 3 * from Products order by newid() ";

with php using random - rand()
string sqlqueryselect = "select * from Products ORDER BY RAND() LIMIT 3 ";

7/10/2009

say helo with asp.net

creat web project with Visual studio 2005
default.cs the first code :
response.write("hello");
CRTL + F5 or F5 to run

7/06/2009

function split remove string

string strchuoi = "helo ai do a o do vay" ; ex:
int n =Convert.ToInt32(strchuoi.Length.ToString());
string[] mang= strchuoi.Split(' ');
int sodoan=0; count
foreach(string y in mang)
{
sodoan=sodoan+1;
}

Response.Write(mang[sodoan-1]);
using trim cut space in string

List

Profiles Information


About me : Nothing is 1 vài thứ - 1985

Places I've Lived : I Hà Nội

Home Page : http://www.shimivn.blogspot.com/

Think : 1:1000000000

Languages spoken : Vietnamese,English.

Mobile : sony C2305

dell : i3-Ram 3GB- HDD 250GB .