制作多重網(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、對Response.Redirect來說,只要是存在的網(wǎng)頁,都可以是被切換的對象。
2、對Server.Transfer來說,去只能切換到同目錄或者是子目錄的.aspx網(wǎng)頁。
3、Response.Redirect切換到另一個網(wǎng)頁之后,瀏覽器的地址將顯示新網(wǎng)址,但是Server.Transfer切換到另外一個網(wǎng)頁后,瀏覽器的地址仍然顯示舊網(wǎng)址,可見Server.Transfer具有保密功能。
網(wǎng)頁間的數(shù)據(jù)傳遞指的是切換到新網(wǎng)頁時,舊網(wǎng)頁傳遞數(shù)據(jù)給新網(wǎng)頁。
1、網(wǎng)址的編碼
利用網(wǎng)址來傳遞數(shù)據(jù),必須注意的是網(wǎng)址的編碼,要編碼的原因是,有此字符有特殊意義,例如:&,它是參數(shù)的分隔符號,解決的方法是必須修改:
調(diào)用Server.URLEncode(變量)對要傳遞的數(shù)據(jù)加以編碼。
2、大量數(shù)據(jù)的傳遞
網(wǎng)頁間傳遞大量數(shù)據(jù)時,Response.Redirect能夠傳遞的數(shù)據(jù)以2KB為限,如果超過就產(chǎn)生錯誤。因此,當所要傳遞的數(shù)據(jù)超過2KB時,務(wù)必要使用Server.Transfer。
Session對象常用屬性:
All 返回全部的Session對象變量到一個數(shù)組
Count 返回Session對象變量的個數(shù)
Item 以索引值或變量名稱來返回或設(shè)定Session
TimeOut 返回或設(shè)定Session對象變量的有效時間,當聯(lián)機用戶超過有效時間沒有動作,Session對象便失效,默認值為20分鐘。
Session對象常用方法:
Add 新增一個Session對象變量
Clear 清除所有的Session對象變量
Remove 以變量名稱來移除變量
RemoveAll 清除所有的Session對象變量
取得Session的值:
Session(''變量名'')=值
Request對象提供了MapPath方法與Path屬性。供服務(wù)器來了解日前被瀏覽網(wǎng)頁的路徑。
使用MapPath方法接收一個字符串類型的參數(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>
1.打印某個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.打印某個對象中的內(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.打印非當前頁
技術(shù)同上,只是在frame顯示中動一點點騙人的手腳
<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.打開新窗口并自動打印
<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è)置了。
為了這個問題,我都要熬白頭了。網(wǎng)上也找了很多代碼,但是總是會存在一些問題。根據(jù)我自己的實際試驗發(fā)現(xiàn)不能用,為找不到對象之類的錯誤提示。
這里給出兩種實際可用的方法:
一。通過注冊表修改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è)置的注冊表地址
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
注意:上面對頁邊距的設(shè)置為:1,實際設(shè)置值為25.4。
昨天發(fā)現(xiàn)這個方法有一個致命的缺點。那就是這個只能在安裝有.Net框架的機子上有效。因為它所調(diào)用的WScript.Shell是.Net框架的...我還以為解決了這個煩人的打印控制了,昨天在客戶端一運行簡直讓我傷心死。呵呵。。。。
難道還要讓對什么是.net都不知道的用戶去安裝.net的框架么。不現(xiàn)實。
所以只能又回到j(luò)avascript中來了。
二。javascript
今天發(fā)現(xiàn)原來以前有時有效有時無效的原因是出在,<input name="idPrint" type="button" value="打印" onclick="doprint()">不能放在頁面的<form runat="server" id="Form1">之內(nèi),客戶端的javascript放在runat server怎么行呢。認識到這個問題就好解決了。以下給出原碼:
<script language="Javascript"><!--
function doprint() {
//保留客戶打印機設(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è)置頁眉頁腳上下左右邊距
factory.printing.header = "頁眉+_+ohiolee的打印世界";
factory.printing.footer = "想設(shè)置頁腳么,這里哦";
factory.printing.topMargin="6";//存在最小默認值5.02
factory.printing.bottomMargin="6";//存在最小默認值4.13
factory.printing.leftMargin="2";//存在最小默認值5.08
factory.printing.rightMargin="2";//存在最小默認值6.79。。。本人機子上測出來是這樣的,不知道普遍是否如此。
//直接打印
factory.DoPrint(false);//true時彈出打印對話框
//返回到原來的打印設(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").來指定頁面中的任何類,并給以進一步屬性設(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)站的。當用戶訪問該網(wǎng)頁時,將自動判斷該瀏覽器是否已裝有,沒有的話,彈出下載警告。同意下載之后,就可以了。
注意不要把<div id="printbtn"><input name="idPrint" type="button" value="打印" onclick="doprint()"></div>放在runat server的form中哦。。。不要再犯像我一樣的錯誤了哦。
Abs(number) 取得數(shù)值的絕對值。
Asc(String) 取得字符串表達式的第一個字符ASCII 碼。
Atn(number) 取得一個角度的反正切值。
CallByName (object, procname, usecalltype,[args()]) 執(zhí)行一個對象的方法、設(shè)定或傳回對象的屬性。
CBool(expression) 轉(zhuǎn)換表達式為Boolean 型態(tài)。
CByte(expression) 轉(zhuǎn)換表達式為Byte 型態(tài)。
CChar(expression) 轉(zhuǎn)換表達式為字符型態(tài)。
CDate(expression) 轉(zhuǎn)換表達式為Date 型態(tài)。
CDbl(expression) 轉(zhuǎn)換表達式為Double 型態(tài)。
CDec(expression) 轉(zhuǎn)換表達式為Decimal 型態(tài)。
CInt(expression) 轉(zhuǎn)換表達式為Integer 型態(tài)。
CLng(expression) 轉(zhuǎn)換表達式為Long 型態(tài)。
CObj(expression) 轉(zhuǎn)換表達式為Object 型態(tài)。
CShort(expression) 轉(zhuǎn)換表達式為Short 型態(tài)。
CSng(expression) 轉(zhuǎn)換表達式為Single 型態(tài)。
CStr(expression) 轉(zhuǎn)換表達式為String 型態(tài)。
Choose (index, choice-1[, choice-2, ... [, choice-n]]) 以索引值來選擇并傳回所設(shè)定的參數(shù)。
Chr(charcode) 以ASCII 碼來取得字符內(nèi)容。
Close(filenumberlist) 結(jié)束使用Open 開啟的檔案。
Cos(number) 取得一個角度的余弦值。
Ctype(expression, typename) 轉(zhuǎn)換表達式的型態(tài)。
DateAdd(dateinterval, number, datetime) 對日期或時間作加減。
DateDiff(dateinterval, date1, date2) 計算兩個日期或時間間的差值。
DatePart (dateinterval, date) 依接收的日期或時間參數(shù)傳回年、月、日或時間。
DateSerial(year, month, day) 將接收的參數(shù)合并為一個只有日期的Date 型態(tài)的數(shù)據(jù)。
DateValue(datetime) 取得符合國別設(shè)定樣式的日期值,并包含時間。
Day(datetime) 依接收的日期參數(shù)傳回日。
Eof(filenumber) 當?shù)诌_一個被開啟的檔案結(jié)尾時會傳回True。
Exp(number) 依接收的參數(shù)傳回e 的次方值。
FileDateTime(pathname) 傳回檔案建立時的日期、時間。
FileLen(pathname) 傳回檔案的長度,單位是Byte。
Filter(sourcearray, match[, include[, compare]]) 搜尋字符串數(shù)組中的指定字符串,凡是數(shù)組元素中含有指定字符串,會將它們結(jié)合成新的字符串數(shù)組并傳回。若是要傳回不含指定字符串的數(shù)組元素,則include 參數(shù)設(shè)為False。compare 參數(shù)則是設(shè)定搜尋時是否區(qū)分大小寫,此時只要給TextCompare 常數(shù)或1 即可。
Fix(number) 去掉參數(shù)的小數(shù)部分并傳回。
Format(expression[, style[, firstdayofweek[, firstweekofyear]]]) 將日期、時間和數(shù)值資料轉(zhuǎn)為每個國家都可以接受的格式。
FormatCurrency(expression[,numdigitsafterdecimal [,includeleadingdigit]]) 將數(shù)值輸出為金額型態(tài)。numdigitsafterdecimal 參數(shù)為小數(shù)字數(shù),includeleadingdigit 參數(shù)為當整數(shù)為0 時是否補至整數(shù)字數(shù)。
FormatDateTime(date[,namedformat]) 傳回格式化的日期或時間數(shù)據(jù)。
FormatNumber(expression[,numdigitsafterdecimal [,includeleadingdigit]]) 傳回格式化的數(shù)值數(shù)據(jù)。Numdigitsafterdecimal 參數(shù)為小數(shù)字數(shù),includeleadingdigit 參數(shù)為當整數(shù)為0 時是否補至整數(shù)字數(shù)。
FormatPercent(expression[,numdigitsafterdecimal [,includeleadingdigit]]) 傳回轉(zhuǎn)換為百分比格式的數(shù)值數(shù)據(jù)。numdigitsafterdecimal 參數(shù)為小數(shù)字數(shù),includeleadingdigit 參數(shù)為當整數(shù)為0 時是否補至整數(shù)字數(shù)。
GetAttr(filename) 傳回檔案或目錄的屬性值。
Hex(number) 將數(shù)值參數(shù)轉(zhuǎn)換為16 進制值。
Hour(time) 傳回時間的小時字段,型態(tài)是Integer。
Iif(expression, truepart, falsepart) 當表達式的傳回值為True 時執(zhí)行truepart 字段的程序,反之則執(zhí)行falsepart 字段。
InStr([start, ]string1, string2) 搜尋string2 參數(shù)設(shè)定的字符出現(xiàn)在字符串的第幾個字符,start 為由第幾個字符開始尋找,string1 為欲搜尋的字符串,string2 為欲搜尋的字符。
Int(number) 傳回小于或等于接收參數(shù)的最大整數(shù)值。
IsArray(varname) 判斷一個變量是否為數(shù)組型態(tài),若為數(shù)組則傳回True,反之則為False。
IsDate(expression) 判斷表達式內(nèi)容是否為DateTime 型態(tài),若是則傳回True,反之則為False。
IsDbNull(expression) 判斷表達式內(nèi)容是否為Null,若是則傳回True,反之則為False。
IsNumeric(expression) 判斷表達式內(nèi)容是否為數(shù)值型態(tài),若是則傳回True,反之則為False。
Join(sourcearray[, delimiter]) 將字符串數(shù)組合并唯一個字符串,delimiter 參數(shù)是設(shè)定在各個元素間加入新的字符串。
Lcase(string) 將字符串轉(zhuǎn)換為小寫字體。
Left(string, length) 由字符串左邊開始取得length 參數(shù)設(shè)定長度的字符。
Len(string) 取得字符串的長度。
Log(number) 取得數(shù)值的自然對數(shù)。
Ltrim(string) 去掉字符串的左邊空白部分。
Mid(string, start[, length]) 取出字符串中strat 參數(shù)設(shè)定的字符后length 長度的字符串,若length 參數(shù)沒有設(shè)定,則取回start 以后全部的字符。
Minute(time) 取得時間內(nèi)容的分部分,型態(tài)為Integer。
MkDir(path) 建立一個新的目錄。
Month(date) 取得日期的月部分,型態(tài)為Integer。
MonthName(month) 依接收的月份數(shù)值取得該月份的完整寫法。
Now() 取得目前的日期和時間。
Oct(number) 將數(shù)值參數(shù)轉(zhuǎn)換為8 進制值。
Replace(expression, find, replace) 將字符串中find 參數(shù)指定的字符串轉(zhuǎn)換為replace 參數(shù)指定的字符串。
Right(string,length) 由字符串右邊開始取得length 參數(shù)設(shè)定長度的字符。
RmDir(path) 移除一個空的目錄。
Rnd() 取得介于0 到1 之間的小數(shù),如果每次都要取得不同的值,使用前需加上Randomize 敘述。
Rtrim(string) 去掉字符串的右邊空白部分。
Second(time) 取得時間內(nèi)容的秒部分,型態(tài)為Integer。
Sign(number) 取得數(shù)值內(nèi)容是正數(shù)或負數(shù),正數(shù)傳回1,負數(shù)傳回-1,0 傳回0。
Sin(number) 取得一個角度的正弦值。
Space(number) 取得number 參數(shù)設(shè)定的空白字符串。
Split(expression[, delimiter]) 以delimiter 參數(shù)設(shè)定的條件字符串來將字符串分割為字符串數(shù)組。
Sqrt(number) 取得一數(shù)值得平方根。
Str(number) 將數(shù)字轉(zhuǎn)為字符串后傳回。
StrReverse(expression) 取得字符串內(nèi)容反轉(zhuǎn)后的結(jié)果。
Tan(number) 取得某個角度的正切值。
TimeOfDay() 取得目前不包含日期的時間。
Timer() 取得由0:00 到目前時間的秒數(shù),型態(tài)為Double。
TimeSerial(hour, minute, second) 將接收的參數(shù)合并為一個只有時間Date 型態(tài)的數(shù)據(jù)。
TimaValue(time) 取得符合國別設(shè)定樣式的時間值。
Today() 取得今天不包含時間的日期。
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)容則會將其去除后,合并為一數(shù)字。
Weekday(date) 取的參數(shù)中的日期是一個星期的第幾天,星期天為1、星期一為2、星期二為3 依此類推。
WeekDayName(number) 依接收的參數(shù)取得星期的名稱,可接收的參數(shù)為1 到7,星期天為1、星期一為2、星期二為3 依此類推。
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯(lián)系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
