.net- 隨手筆記

摘要:Net 筆記

[2.0] string.IsNullOrEmpty
============================================================================


語法:Math.Ceiling(x)
功能:取得大於或等於參數的最小整數值。
範例:
n =Math.ceiling(87.39)  ‘n = 88
n = Math.ceiling(-87.39)  ‘n = -87
============================================================================

 

Double.Parse(String)
將數字的字串表示轉換為其對等的雙精確度浮點數。
============================================================================

 

 

Private void dgMemberList_ItemDataBound(object sender, DataGridItemEventArgs e)
{
	hourtotal = Convert.ToInt32(((DataRowView)e.Item.DataItem).Row["StudyTime"].ToString())/3600;
}

============================================================================

 

 

using System.IO.FileStream
using System.IO.StreamReader
using System.IO.File

using(StreamReader Sr = new StreamReader(FilePath))
{
	int i=0;
	string str="";
	
	while(str=Sr.ReadLine()!=null)
	{
		if(i==4)
		{
			Response.Write(str)
			break;
		}
		i++;
	}
	Sr.Close(); 
}


StreamReader Sr = new StreamReader(FilePath);
string str = sr.ReadToEnd().Split(' \n')[LineIdx];
Sr.Close();


string[] strAry = System.IO.File.ReadAllLines(FilePath);
string str = System.IO.File.ReadAllText(FilePath);


============================================================================

string txtUrl = System.IO.Path.GetFileName(Request.PhysicalPath)+Request.Url.Query;
取得網址中的檔案名稱+網址的參數