日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

ASP.Net網(wǎng)頁設(shè)計(jì)常用代碼

系統(tǒng) 2852 0

制作多重網(wǎng)頁,除了必須懂得如何傳遞數(shù)據(jù)之外,還必須懂得如何切換網(wǎng)頁。

在Asp.Net程序中,切換網(wǎng)頁的方法有兩種:
Response.Redirect(''網(wǎng)頁'')
Server.Transfer(''.aspx網(wǎng)頁'')

Response.Redirect和Server.Transfer的區(qū)別是:
1、對(duì)Response.Redirect來說,只要是存在的網(wǎng)頁,都可以是被切換的對(duì)象。
2、對(duì)Server.Transfer來說,去只能切換到同目錄或者是子目錄的.aspx網(wǎng)頁。
3、Response.Redirect切換到另一個(gè)網(wǎng)頁之后,瀏覽器的地址將顯示新網(wǎng)址,但是Server.Transfer切換到另外一個(gè)網(wǎng)頁后,瀏覽器的地址仍然顯示舊網(wǎng)址,可見Server.Transfer具有保密功能。

網(wǎng)頁間的數(shù)據(jù)傳遞指的是切換到新網(wǎng)頁時(shí),舊網(wǎng)頁傳遞數(shù)據(jù)給新網(wǎng)頁。

1、網(wǎng)址的編碼
利用網(wǎng)址來傳遞數(shù)據(jù),必須注意的是網(wǎng)址的編碼,要編碼的原因是,有此字符有特殊意義,例如:&,它是參數(shù)的分隔符號(hào),解決的方法是必須修改:
調(diào)用Server.URLEncode(變量)對(duì)要傳遞的數(shù)據(jù)加以編碼。

2、大量數(shù)據(jù)的傳遞
網(wǎng)頁間傳遞大量數(shù)據(jù)時(shí),Response.Redirect能夠傳遞的數(shù)據(jù)以2KB為限,如果超過就產(chǎn)生錯(cuò)誤。因此,當(dāng)所要傳遞的數(shù)據(jù)超過2KB時(shí),務(wù)必要使用Server.Transfer。

Session對(duì)象常用屬性:
All 返回全部的Session對(duì)象變量到一個(gè)數(shù)組
Count 返回Session對(duì)象變量的個(gè)數(shù)
Item 以索引值或變量名稱來返回或設(shè)定Session
TimeOut 返回或設(shè)定Session對(duì)象變量的有效時(shí)間,當(dāng)聯(lián)機(jī)用戶超過有效時(shí)間沒有動(dòng)作,Session對(duì)象便失效,默認(rèn)值為20分鐘。

Session對(duì)象常用方法:
Add 新增一個(gè)Session對(duì)象變量
Clear 清除所有的Session對(duì)象變量
Remove 以變量名稱來移除變量
RemoveAll 清除所有的Session對(duì)象變量

取得Session的值:
Session(''變量名'')=值

Request對(duì)象提供了MapPath方法與Path屬性。供服務(wù)器來了解日前被瀏覽網(wǎng)頁的路徑。

使用MapPath方法接收一個(gè)字符串類型的參數(shù),并且返回目前所在的實(shí)際路徑以及與傳入字符串的結(jié)合。

例如:Request.MapPath(''aa.aspx'')

<script>
function regInput(obj, reg, inputStr)
{
var docSel = document.selection.createRange()
if (docSel.parentElement().tagName != "INPUT") return false
oSel = docSel.duplicate()
oSel.text = ""
var srcRange = obj.createTextRange()
oSel.setEndPoint("StartToStart", srcRange)
var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
return reg.test(str)
}
</script>

小寫英文:<xmp style= "display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^[a-z]*$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^[a-z]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[a-z]*$/, event.dataTransfer.getData('Text'))"
style="ime-mode:Disabled"
><br>

大寫英文:<xmp style= "display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^[A-Z]*$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^[A-Z]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[A-Z]*$/, event.dataTransfer.getData('Text'))"
style="ime-mode:Disabled">
<br>

任意數(shù)字:<xmp style="display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^[0-9]*$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^[0-9]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[0-9]*$/, event.dataTransfer.getData('Text'))"
style="ime-mode:Disabled"
><br>

限2位小數(shù):<xmp style="display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^\d*\.?\d{0,2}$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^\d*\.?\d{0,2}$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^\d*\.?\d{0,2}$/, event.dataTransfer.getData('Text'))"
style="ime-mode:Disabled"
> 如: 123.12<br>


日  期:<xmp style="display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^\d{1,4}([-\/](\d{1,2}([-\/](\d{1,2})?)?)?)?$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^\d{1,4}([-\/](\d{1,2}([-\/](\d{1,2})?)?)?)?$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^\d{1,4}([-\/](\d{1,2}([-\/](\d{1,2})?)?)?)?$/, event.dataTransfer.getData('Text'))"
style="ime-mode:Disabled"
> 如: 2002-9-29<br>

任意中文:<xmp style="display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^[\u4E00-\u9FA5]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[\u4E00-\u9FA5]*$/, event.dataTransfer.getData('Text'))"
><br>

部分英文:<xmp style="display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^[a-e]*$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^[a-e]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[a-e]*$/, event.dataTransfer.getData('Text'))"
style="ime-mode:Disabled"
> 范圍: a,b,c,d,e<br>

部分中文:<xmp style="display:inline"> </xmp>

<script language=javascript>
function checkChinese(oldLength, obj)
{
var oTR = window.document.selection.createRange()
var reg = /[^一二三四五六七八九十]/g
oTR.moveStart("character", -1*(obj.value.length-oldLength))
oTR.text = oTR.text.replace(reg, "")
}
</script>
<input onkeypress="return false" onkeydown="setTimeout('checkChinese('+this.value.length+','+this.uniqueID+')', 1)"
onpaste = "return regInput(this, /^[一二三四五六七八九十]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[一二三四五六七八九十]*$/, event.dataTransfer.getData('Text'))"
> 范圍: 一二三四五六七八九十<br>

特定內(nèi)容的部分打印技術(shù)
1.打印某個(gè)frame的內(nèi)容(frameB)
<html>
<frameset rows="20%,*">
<frame SRC="framea.htm" name="FrameA" noresize>
<frame SRC="frameb.htm" name="FrameB" noresize>
<noframes>
<body>
</body>
</noframes>
</frameset>
</html>

frameA中添加
<input type="button" value="Print the other frame" onclick="parent.frameB.print();">

2.打印某個(gè)對(duì)象中的內(nèi)容,如textbox中的內(nèi)容
frameA:
<html><head>
</head>
<body>
<form name="formB" action="javascript:window.print()">
<input type="text" name="textboxb" size="12" value="Print Me">
</form>
</body></html>
frameB:
<html><head>
<script>
function printotherframe()
{
parent.FrameB.formB.textboxb.focus()
parent.FrameB.formB.submit()
}
</script>
</head><body>
<form name="formA"><input type="button" value="Print the other frame" onclick="printotherframe()">
</body></html>

3.打印非當(dāng)前頁
技術(shù)同上,只是在frame顯示中動(dòng)一點(diǎn)點(diǎn)騙人的手腳
<frameset rows="100%,*">
<frame src="controlpage.html">
<frame src="pagetoprint.html">
</frameset>

<script language="JavaScript"><!--
if (window.print)
document.write('<form><input type="button" value="Print" onClick="parent.frames[1].focus();parent.frames[1].print()"><\/form>');
//--></script>

4.統(tǒng)一頁眉頁腳
<script language="Javascript"><!--
function doprint() {
//save existing user's info
var h = factory.printing.header;
var f = factory.printing.footer;
//hide the button
document.all("printbtn").style.visibility = 'hidden';
//set header and footer to blank
factory.printing.header = "";
factory.printing.footer = "";
//print page without prompt
factory.DoPrint(false);
//restore user's info
factory.printing.header = h;
factory.printing.footer = f;
//show the print button
document.all("printbtn").style.visibility = 'visible';
}
//--></script>
<body>
<br><br><br>
<object id=factory style="display:none"classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" viewastext codebase="ScriptX.cab#Version=5,0,4,185">
</object>
<br><br>
<div id="printbtn"><input name=idPrint type=button value="Print the letter" onclick="doprint()"></div>
</body>

5.打開新窗口并自動(dòng)打印
<object id=WBControl width=0 height=0 classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2></object>
<script language=VBScript><!-- //
Sub VBPrint() On Error Resume Next
WBControl.ExecWB 6,1'7,2在不少文章中都有提到,這里就不多說了。
End Sub
//--></script>

<script language=JavaScript><!-- //
if (window.print) self.print();
else if (navigator.appName.indexOf('Microsoft') !=-1) VBPrint()
setTimeout('self.close()',3000);'看代碼相信大家都能明白。如果有不明白的歡迎留言
//--></script>
html中
<form>
<input type="button" value="Print Price List" onClick="window.open('pricelist.html','newwin');">
</form>

在ASP.Net中最為頭痛的可能就是打印設(shè)置了。
為了這個(gè)問題,我都要熬白頭了。網(wǎng)上也找了很多代碼,但是總是會(huì)存在一些問題。根據(jù)我自己的實(shí)際試驗(yàn)發(fā)現(xiàn)不能用,為找不到對(duì)象之類的錯(cuò)誤提示。

這里給出兩種實(shí)際可用的方法:

一。通過注冊(cè)表修改IE打印設(shè)置
<HTML>
<HEAD>
<TITLE>New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="YC">
<script language="VBScript">
dim hkey_root,hkey_path,hkey_key
hkey_root="HKEY_CURRENT_USER"
hkey_path="\Software\Microsoft\Internet Explorer\PageSetup" //IE打印設(shè)置的注冊(cè)表地址

function pagesetup_null()
on error resume next
Set RegWsh = CreateObject("WScript.Shell")
hkey_key="\header"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"" //頁眉
hkey_key="\footer"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"" //頁腳
hkey_key="\margin_left"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"1" //鍵值設(shè)定--左邊邊界
hkey_key="\margin_top"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"1"
hkey_key="\margin_right"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"1"
hkey_key="\margin_bottom"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"1"
end function
'//

function pagesetup_default()
on error resume next
Set RegWsh = CreateObject("WScript.Shell")
hkey_key="\header"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"&w&b頁,&p/&P" //頁數(shù)-
hkey_key="\footer"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"&u&b&d" //網(wǎng)址,日期等信息
end function
</script>
</HEAD>
<BODY>
<table width="100%" border=2 cellspacing=1 align=center cellpadding=1 id=tb1>
<tr>
<td>
<br>
<br>
<br>
<p align="center">
<input type="button" value="Clean" onclick="pagesetup_null()"> <input type="button" value="Reset" onclick="pagesetup_default()"><br>
</p>
</td>
</tr>
</table>
</BODY>
</HTML> dim hkey_root,hkey_path,hkey_key hkey_root="HKEY_CURRENT_USER" hkey_path="\Software\Microsoft\Internet Explorer\PageSetup" function pagesetup_null() on error resume next Set RegWsh = CreateObject("WScript.Shell") hkey_key="\header" RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"" hkey_key="\footer" RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"" hkey_key="\margin_left" RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"1" hkey_key="\margin_top" RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"1" hkey_key="\margin_right" RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"1" hkey_key="\margin_bottom" RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"1" window.alert(hkey_root+hkey_path) end function '// function pagesetup_default() on error resume next Set RegWsh = CreateObject("WScript.Shell") hkey_key="\header" RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"&w&bページ,&p/&P" hkey_key="\footer" RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"&u&b&d" end function

除了以上鍵值以外還有
duplex
orientation
paper_size
paper_source
printer

注意:上面對(duì)頁邊距的設(shè)置為:1,實(shí)際設(shè)置值為25.4。

昨天發(fā)現(xiàn)這個(gè)方法有一個(gè)致命的缺點(diǎn)。那就是這個(gè)只能在安裝有.Net框架的機(jī)子上有效。因?yàn)樗{(diào)用的WScript.Shell是.Net框架的...我還以為解決了這個(gè)煩人的打印控制了,昨天在客戶端一運(yùn)行簡(jiǎn)直讓我傷心死。呵呵。。。。

難道還要讓對(duì)什么是.net都不知道的用戶去安裝.net的框架么。不現(xiàn)實(shí)。
所以只能又回到j(luò)avascript中來了。

二。javascript
今天發(fā)現(xiàn)原來以前有時(shí)有效有時(shí)無效的原因是出在,<input name="idPrint" type="button" value="打印" onclick="doprint()">不能放在頁面的<form runat="server" id="Form1">之內(nèi),客戶端的javascript放在runat server怎么行呢。認(rèn)識(shí)到這個(gè)問題就好解決了。以下給出原碼:

<script language="Javascript"><!--
function doprint() {
//保留客戶打印機(jī)設(shè)置
var h = factory.printing.header;
var f = factory.printing.footer;
var t = factory.printing.topMargin;
var b = factory.printing.bottomMargin;
var l = factory.printing.leftMargin;
var r = factory.printing.rightMargin;

document.all("printbtn").style.visibility = 'hidden';//打印時(shí)隱藏打印按鈕
//設(shè)置頁眉頁腳上下左右邊距
factory.printing.header = "頁眉+_+ohiolee的打印世界";
factory.printing.footer = "想設(shè)置頁腳么,這里哦";
factory.printing.topMargin="6";//存在最小默認(rèn)值5.02
factory.printing.bottomMargin="6";//存在最小默認(rèn)值4.13
factory.printing.leftMargin="2";//存在最小默認(rèn)值5.08
factory.printing.rightMargin="2";//存在最小默認(rèn)值6.79。。。本人機(jī)子上測(cè)出來是這樣的,不知道普遍是否如此。
//直接打印
factory.DoPrint(false);//true時(shí)彈出打印對(duì)話框
//返回到原來的打印設(shè)置
factory.printing.header = h;
factory.printing.footer = f;
factory.printing.topMargin=t;
factory.printing.bottomMargin=b;
factory.printing.leftMargin=l;
factory.printing.rightMargin=r;
//顯示打印按鈕
document.all("printbtn").style.visibility = 'visible';//通過document.all("printbtn").來指定頁面中的任何類,并給以進(jìn)一步屬性設(shè)置
}
//--></script>
</HEAD>
<body>
<OBJECT id="factory" style="DISPLAY: none" codeBase="ScriptX.cab#Version=5,0,4,185" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
viewastext>
</OBJECT>
<div id="printbtn"><input name="idPrint" type="button" value="打印" onclick="doprint()"></div>

codeBase=" http://www.meadroid.com/scriptx/ScriptX.cab#Version=5,60,0,360 " 這里需要給出ActiveX ScriptX.cab的地址,你可以下載到自己的網(wǎng)站中并提供出來,也可以引用其他網(wǎng)站的。當(dāng)用戶訪問該網(wǎng)頁時(shí),將自動(dòng)判斷該瀏覽器是否已裝有,沒有的話,彈出下載警告。同意下載之后,就可以了。

注意不要把<div id="printbtn"><input name="idPrint" type="button" value="打印" onclick="doprint()"></div>放在runat server的form中哦。。。不要再犯像我一樣的錯(cuò)誤了哦。

Abs(number) 取得數(shù)值的絕對(duì)值。
Asc(String) 取得字符串表達(dá)式的第一個(gè)字符ASCII 碼。
Atn(number) 取得一個(gè)角度的反正切值。
CallByName (object, procname, usecalltype,[args()]) 執(zhí)行一個(gè)對(duì)象的方法、設(shè)定或傳回對(duì)象的屬性。
CBool(expression) 轉(zhuǎn)換表達(dá)式為Boolean 型態(tài)。
CByte(expression) 轉(zhuǎn)換表達(dá)式為Byte 型態(tài)。
CChar(expression) 轉(zhuǎn)換表達(dá)式為字符型態(tài)。
CDate(expression) 轉(zhuǎn)換表達(dá)式為Date 型態(tài)。
CDbl(expression) 轉(zhuǎn)換表達(dá)式為Double 型態(tài)。
CDec(expression) 轉(zhuǎn)換表達(dá)式為Decimal 型態(tài)。
CInt(expression) 轉(zhuǎn)換表達(dá)式為Integer 型態(tài)。
CLng(expression) 轉(zhuǎn)換表達(dá)式為L(zhǎng)ong 型態(tài)。
CObj(expression) 轉(zhuǎn)換表達(dá)式為Object 型態(tài)。
CShort(expression) 轉(zhuǎn)換表達(dá)式為Short 型態(tài)。
CSng(expression) 轉(zhuǎn)換表達(dá)式為Single 型態(tài)。
CStr(expression) 轉(zhuǎn)換表達(dá)式為String 型態(tài)。
Choose (index, choice-1[, choice-2, ... [, choice-n]]) 以索引值來選擇并傳回所設(shè)定的參數(shù)。
Chr(charcode) 以ASCII 碼來取得字符內(nèi)容。
Close(filenumberlist) 結(jié)束使用Open 開啟的檔案。
Cos(number) 取得一個(gè)角度的余弦值。
Ctype(expression, typename) 轉(zhuǎn)換表達(dá)式的型態(tài)。
DateAdd(dateinterval, number, datetime) 對(duì)日期或時(shí)間作加減。
DateDiff(dateinterval, date1, date2) 計(jì)算兩個(gè)日期或時(shí)間間的差值。
DatePart (dateinterval, date) 依接收的日期或時(shí)間參數(shù)傳回年、月、日或時(shí)間。
DateSerial(year, month, day) 將接收的參數(shù)合并為一個(gè)只有日期的Date 型態(tài)的數(shù)據(jù)。
DateValue(datetime) 取得符合國(guó)別設(shè)定樣式的日期值,并包含時(shí)間。
Day(datetime) 依接收的日期參數(shù)傳回日。
Eof(filenumber) 當(dāng)?shù)诌_(dá)一個(gè)被開啟的檔案結(jié)尾時(shí)會(huì)傳回True。
Exp(number) 依接收的參數(shù)傳回e 的次方值。
FileDateTime(pathname) 傳回檔案建立時(shí)的日期、時(shí)間。
FileLen(pathname) 傳回檔案的長(zhǎng)度,單位是Byte。
Filter(sourcearray, match[, include[, compare]]) 搜尋字符串?dāng)?shù)組中的指定字符串,凡是數(shù)組元素中含有指定字符串,會(huì)將它們結(jié)合成新的字符串?dāng)?shù)組并傳回。若是要傳回不含指定字符串的數(shù)組元素,則include 參數(shù)設(shè)為False。compare 參數(shù)則是設(shè)定搜尋時(shí)是否區(qū)分大小寫,此時(shí)只要給TextCompare 常數(shù)或1 即可。
Fix(number) 去掉參數(shù)的小數(shù)部分并傳回。
Format(expression[, style[, firstdayofweek[, firstweekofyear]]]) 將日期、時(shí)間和數(shù)值資料轉(zhuǎn)為每個(gè)國(guó)家都可以接受的格式。
FormatCurrency(expression[,numdigitsafterdecimal [,includeleadingdigit]]) 將數(shù)值輸出為金額型態(tài)。numdigitsafterdecimal 參數(shù)為小數(shù)字?jǐn)?shù),includeleadingdigit 參數(shù)為當(dāng)整數(shù)為0 時(shí)是否補(bǔ)至整數(shù)字?jǐn)?shù)。
FormatDateTime(date[,namedformat]) 傳回格式化的日期或時(shí)間數(shù)據(jù)。
FormatNumber(expression[,numdigitsafterdecimal [,includeleadingdigit]]) 傳回格式化的數(shù)值數(shù)據(jù)。Numdigitsafterdecimal 參數(shù)為小數(shù)字?jǐn)?shù),includeleadingdigit 參數(shù)為當(dāng)整數(shù)為0 時(shí)是否補(bǔ)至整數(shù)字?jǐn)?shù)。
FormatPercent(expression[,numdigitsafterdecimal [,includeleadingdigit]]) 傳回轉(zhuǎn)換為百分比格式的數(shù)值數(shù)據(jù)。numdigitsafterdecimal 參數(shù)為小數(shù)字?jǐn)?shù),includeleadingdigit 參數(shù)為當(dāng)整數(shù)為0 時(shí)是否補(bǔ)至整數(shù)字?jǐn)?shù)。
GetAttr(filename) 傳回檔案或目錄的屬性值。
Hex(number) 將數(shù)值參數(shù)轉(zhuǎn)換為16 進(jìn)制值。
Hour(time) 傳回時(shí)間的小時(shí)字段,型態(tài)是Integer。
Iif(expression, truepart, falsepart) 當(dāng)表達(dá)式的傳回值為True 時(shí)執(zhí)行truepart 字段的程序,反之則執(zhí)行falsepart 字段。
InStr([start, ]string1, string2) 搜尋string2 參數(shù)設(shè)定的字符出現(xiàn)在字符串的第幾個(gè)字符,start 為由第幾個(gè)字符開始尋找,string1 為欲搜尋的字符串,string2 為欲搜尋的字符。
Int(number) 傳回小于或等于接收參數(shù)的最大整數(shù)值。
IsArray(varname) 判斷一個(gè)變量是否為數(shù)組型態(tài),若為數(shù)組則傳回True,反之則為False。
IsDate(expression) 判斷表達(dá)式內(nèi)容是否為DateTime 型態(tài),若是則傳回True,反之則為False。
IsDbNull(expression) 判斷表達(dá)式內(nèi)容是否為Null,若是則傳回True,反之則為False。
IsNumeric(expression) 判斷表達(dá)式內(nèi)容是否為數(shù)值型態(tài),若是則傳回True,反之則為False。
Join(sourcearray[, delimiter]) 將字符串?dāng)?shù)組合并唯一個(gè)字符串,delimiter 參數(shù)是設(shè)定在各個(gè)元素間加入新的字符串。
Lcase(string) 將字符串轉(zhuǎn)換為小寫字體。
Left(string, length) 由字符串左邊開始取得length 參數(shù)設(shè)定長(zhǎng)度的字符。
Len(string) 取得字符串的長(zhǎng)度。
Log(number) 取得數(shù)值的自然對(duì)數(shù)。
Ltrim(string) 去掉字符串的左邊空白部分。
Mid(string, start[, length]) 取出字符串中strat 參數(shù)設(shè)定的字符后length 長(zhǎng)度的字符串,若length 參數(shù)沒有設(shè)定,則取回start 以后全部的字符。
Minute(time) 取得時(shí)間內(nèi)容的分部分,型態(tài)為Integer。
MkDir(path) 建立一個(gè)新的目錄。
Month(date) 取得日期的月部分,型態(tài)為Integer。
MonthName(month) 依接收的月份數(shù)值取得該月份的完整寫法。
Now() 取得目前的日期和時(shí)間。
Oct(number) 將數(shù)值參數(shù)轉(zhuǎn)換為8 進(jìn)制值。
Replace(expression, find, replace) 將字符串中find 參數(shù)指定的字符串轉(zhuǎn)換為replace 參數(shù)指定的字符串。
Right(string,length) 由字符串右邊開始取得length 參數(shù)設(shè)定長(zhǎng)度的字符。
RmDir(path) 移除一個(gè)空的目錄。
Rnd() 取得介于0 到1 之間的小數(shù),如果每次都要取得不同的值,使用前需加上Randomize 敘述。
Rtrim(string) 去掉字符串的右邊空白部分。
Second(time) 取得時(shí)間內(nèi)容的秒部分,型態(tài)為Integer。
Sign(number) 取得數(shù)值內(nèi)容是正數(shù)或負(fù)數(shù),正數(shù)傳回1,負(fù)數(shù)傳回-1,0 傳回0。
Sin(number) 取得一個(gè)角度的正弦值。
Space(number) 取得number 參數(shù)設(shè)定的空白字符串。
Split(expression[, delimiter]) 以delimiter 參數(shù)設(shè)定的條件字符串來將字符串分割為字符串?dāng)?shù)組。
Sqrt(number) 取得一數(shù)值得平方根。
Str(number) 將數(shù)字轉(zhuǎn)為字符串后傳回。
StrReverse(expression) 取得字符串內(nèi)容反轉(zhuǎn)后的結(jié)果。
Tan(number) 取得某個(gè)角度的正切值。
TimeOfDay() 取得目前不包含日期的時(shí)間。
Timer() 取得由0:00 到目前時(shí)間的秒數(shù),型態(tài)為Double。
TimeSerial(hour, minute, second) 將接收的參數(shù)合并為一個(gè)只有時(shí)間Date 型態(tài)的數(shù)據(jù)。
TimaValue(time) 取得符合國(guó)別設(shè)定樣式的時(shí)間值。
Today() 取得今天不包含時(shí)間的日期。
Trim(string) 去掉字符串開頭和結(jié)尾的空白。
TypeName(varname) 取得變量或?qū)ο蟮男蛻B(tài)。
Ubound(arrayname[, dimension]) 取得數(shù)組的最終索引值,dimension 參數(shù)是指定取得第幾維度的最終索引值。
Ucase(string) 將字符串轉(zhuǎn)換為大寫。
Val(string) 將代表數(shù)字的字符串轉(zhuǎn)換為數(shù)值型態(tài),若字符串中含有非數(shù)字的內(nèi)容則會(huì)將其去除后,合并為一數(shù)字。
Weekday(date) 取的參數(shù)中的日期是一個(gè)星期的第幾天,星期天為1、星期一為2、星期二為3 依此類推。
WeekDayName(number) 依接收的參數(shù)取得星期的名稱,可接收的參數(shù)為1 到7,星期天為1、星期一為2、星期二為3 依此類推。



ASP.Net網(wǎng)頁設(shè)計(jì)常用代碼


更多文章、技術(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ì)您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長(zhǎng)會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 南昌县| 平邑县| 北碚区| 竹溪县| 侯马市| 东乌珠穆沁旗| 固镇县| 大连市| 长沙县| 黄山市| 尼玛县| 奉节县| 翼城县| 丹凤县| 祁门县| 中山市| 任丘市| 海宁市| 资中县| 易门县| 泽州县| 明溪县| 扬州市| 汝南县| 小金县| 武胜县| 东兰县| 昭通市| 治县。| 浦北县| 花垣县| 应城市| 遂川县| 商丘市| 顺昌县| 济南市| 阿克苏市| 屏东市| 高州市| 彰武县| 布拖县|