2009年4月20日 星期一

Request

網址:http://localhost:1897/News/Press/Content.aspx/123?id=1#toc
Request.ApplicationPath /
Request.PhysicalPath D:\Projects\Solution\web\News\Press\Content.aspx
System.IO.Path.GetDirectoryName(Request.PhysicalPath) D:\Projects\Solution\web\News\Press
Request.PhysicalApplicationPath D:\Projects\Solution\web\
System.IO.Path.GetFileName(Request.PhysicalPath) Content.aspx
Request.CurrentExecutionFilePath /News/Press/Content.aspx
Request.FilePath /News/Press/Content.aspx
Request.Path /News/Press/Content.aspx/123
Request.RawUrl /News/Press/Content.aspx/123?id=1
Request.Url.AbsolutePath /News/Press/Content.aspx/123
Request.Url.AbsoluteUri http://localhost:1897/News/Press/Content.aspx/123?id=1
Request.Url.Scheme http
Request.Url.Host localhost
Request.Url.Port 1897
Request.Url.Authority localhost:1897
Request.Url.LocalPath /News/Press/Content.aspx/123
Request.PathInfo /123
Request.Url.PathAndQuery /News/Press/Content.aspx/123?id=1
Request.Url.Query ?id=1
Request.Url.Fragment
Request.Url.Segments /
News/
Press/
Content.aspx/
123

2009年4月10日 星期五

SqlServer Sql Join Other Database's Table

SELECT DISTINCT(a.brk_id), b.brk_na FROM SkTrans a LEFT JOIN ITF_ApexFin0408..BrkBase b ON a.brk_id = b.brk_id COLLATE Chinese_Taiwan_Stroke_CI_AS
WHERE 1=1

要兩個點喔~~

2009年4月9日 星期四

SqlTransaction

string connect_string = "server=win2003;uid=sa;pwd=PASSWORD;database=MyDB";
SqlConnection conn = new SqlConnection(connect_string);
conn.Open();
SqlTransaction transaction = conn.BeginTransaction();

try
{
SqlCommand users = new SqlCommand("insert into Users(userid, pwd)
values('" + userid + "', '" + pwd + "')", conn);
users.Transaction = transaction;
users.ExecuteNonQuery();

SqlCommand friends = new SqlCommand("insert into friends(userid, friendid)
values('" + userid + "', '" + friend1 + "')", conn);
friends.Transaction = transaction;
friends.ExecuteNonQuery();

transaction.Commit();
}
catch
{
transaction.Rollback();
}
finally
{
conn.Close();
}

2009年4月5日 星期日

一些.NET的工具(有要錢的)

UI & AJAX CallBack:

Devexpress (WinForm, WebForm)
http://www.devexpress.com/

JQuery UI (WebForm)
http://jqueryui.com


DataBase:

LLBLGen Pro - O/R Mapper Generator
http://www.llblgen.com

XCase - database design tool
http://www.xcase.com/

製作討人厭的防右鍵~~XD

1.
body add ----
onDragStart="return false" onContextmenu="return false" onSelectStart="return false"

2.
JavaScript ---
if (navigator.appName.indexOf("Internet Explorer") != -1)
document.onmousedown = noSourceExplorer;

function noSourceExplorer()
{
if (event.button == 2 | event.button == 3)
{
alert("Text");
}
}

ASP.NET HyperLink CSS

ASP.NET HyperLink CSS
a.css1:link { color: #B56AB5;}
a.css1:visited { color:#B56AB5; }
a.css1:hover { color:#FFFFFF; }