2007年3月小記
系統(tǒng)
1594 0
1、使用System.Web.Hosting.HostingEnvironment.MapPath方法也可以獲取"~/path/*.*"文件的絕對(duì)路徑。
2、在IIS7使用ASP.NET AJAX時(shí),網(wǎng)站的應(yīng)用程序池必須設(shè)置為集成模式(integrated)
3、SQL數(shù)據(jù)庫(kù)遠(yuǎn)程鏈接。
????
--
遠(yuǎn)程鏈接獲取信息
????
EXEC
?sp_addlinkedserver?
????????
@server
=
'
ls_instance
'
,
--
別名
????????
@provider
=
'
SQLOLEDB
'
,
????????
@srvproduct
=
''
,
????????
@datasrc
=
'www.cnblogs.com
'
--
遠(yuǎn)程服務(wù)器名
????
EXEC
?sp_addlinkedsrvlogin?
????????
@rmtsrvname
=
'
ls_instance
'
,
????????
@useself
=
'
false
'
,
????????
@locallogin
=
'
sa
'
,
????????
@rmtuser
=
'
sa
'
,
????????
@rmtpassword
=
'
123456
'
????
EXEC
?sp_droplinkedsrvlogin?
'
ls_instance
'
,?
'
sa
'
????
--
EXEC?sp_linkedservers
????
EXEC
?sp_dropserver?
'
ls_instance
'
4、如何在VS2005 SP1中打開HTML編輯器中的元素的屬性顯示?
??????工具-->選項(xiàng)-->文本編輯器-->HTML-->雜項(xiàng)-->選擇“在源視圖中啟用屬性網(wǎng)格”
?
5、導(dǎo)出某列表控件到一個(gè)Excel表格
????
public
?
void
?ToExcel(System.Web.UI.Control?ctl)
????
{
????????Response.Clear();
????????Response.AppendHeader(
"
Content-Disposition
"
,?
"
attachment;filename=Excel.xls
"
);
????????Response.Charset?
=
?
"
GB2312
"
;
????????Response.ContentEncoding?
=
?System.Text.Encoding.GetEncoding(
"
GB2312
"
);
????????Response.ContentType?
=
?
"
application/ms-excel
"
;
????????ctl.Page.EnableViewState?
=
?
false
;
????????System.IO.StringWriter?tw?
=
?
new
?System.IO.StringWriter();
????????System.Web.UI.HtmlTextWriter?hw?
=
?
new
?System.Web.UI.HtmlTextWriter(tw);
????????ctl.RenderControl(hw);
????????HttpContext.Current.Response.Write(tw.ToString());
????????HttpContext.Current.Response.End();
????}
6、簡(jiǎn)單判斷是否為IE。 if(!document.uniqueID) window.location = window.location;
7、在ASP.NET AJAX中如何判斷瀏覽器及計(jì)算其寬高。
????????????
function
?getClientBounds()
????????????
{
????????????????
var
?clientWidth;
????????????????
var
?clientHeight;
????????????????
switch
(Sys.Browser.agent)?
{
????????????????????
case
?Sys.Browser.InternetExplorer:
????????????????????????clientWidth?
=
?document.documentElement.clientWidth;
????????????????????????clientHeight?
=
?document.documentElement.clientHeight;
????????????????????????
break
;
????????????????????
case
?Sys.Browser.Safari:
????????????????????????clientWidth?
=
?window.innerWidth;
????????????????????????clientHeight?
=
?window.innerHeight;
????????????????????????
break
;
????????????????????
case
?Sys.Browser.Opera:
????????????????????????clientWidth?
=
?Math.min(window.innerWidth,?document.body.clientWidth);
????????????????????????clientHeight?
=
?Math.min(window.innerHeight,?document.body.clientHeight);
????????????????????????
break
;
????????????????????
default
:??
//
?Sys.Browser.Firefox,?etc.
????????????????????????clientWidth?
=
?Math.min(window.innerWidth,?document.documentElement.clientWidth);
????????????????????????clientHeight?
=
?Math.min(window.innerHeight,?document.documentElement.clientHeight);
????????????????????????
break
;
????????????????}
????????????????
return
?
new
?Sys.UI.Bounds(
0
,?
0
,?clientWidth,?clientHeight);
????????????}
8、
Vista側(cè)邊欄安裝與配置
9、Passport學(xué)習(xí):
Passport 身份驗(yàn)證
?
在ASP.NET應(yīng)用程序中集成Passport驗(yàn)證
2007年3月小記
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061
微信掃一掃加我為好友
QQ號(hào)聯(lián)系: 360901061
您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對(duì)您有幫助就好】元