亚洲欧美精品沙发,日韩在线精品视频,亚洲Av每日更新在线观看,亚洲国产另类一区在线5

<pre id="hdphd"></pre>

  • <div id="hdphd"><small id="hdphd"></small></div>
      學(xué)習(xí)啦 > 創(chuàng)業(yè)指南 > 職場(chǎng) > 面試題 >

      有哪些ASP面試題

      時(shí)間: 書榮1192 分享

        ASP即Active Server Pages,是MicroSoft公司開發(fā)的服務(wù)器端腳本環(huán)境,可用來創(chuàng)建動(dòng)態(tài)交互式網(wǎng)頁(yè)并建立強(qiáng)大的web應(yīng)用程序。下面是學(xué)習(xí)啦小編為你整理的ASP面試題,希望對(duì)你有所幫助!


        第一題:ASP中,VBScript的唯一的數(shù)據(jù)類型是什么?

        第二題:在ASP中,VBScript有多種控制程序流程語句,如If…Then, Select… Case,

        For … Next, Do … Loop, Exit等語句。請(qǐng)為這五個(gè)語句分別寫一段使用的代碼。

        第三題:請(qǐng)看如下代碼

        這段代碼執(zhí)行后,運(yùn)行結(jié)果是什么?并解釋一下為什么?

        第四題:在ASP中,Server中有一個(gè)方法是URLEncode(string)

        如: response.write Server.URLEncode(“Test.ASP?TestNum=100&TestStr=你好”)

        結(jié)果輸出: Test%2EASP%3FTestNum%3D100%26TestStr%3D%C4%E3%BA%C3

        在ASP中,有ASC(String),Hex(Number),Mid(String,start,[,length])這三個(gè)可能用

        到的函數(shù),如果是三個(gè)函數(shù)的用法

        如:

        ASC(“A”)=65,ASC(“你”)= -15133

        Hex(65)=”41″,Hex(-15133)=”C4E3″

        Mid(“hello”,2,1)=”e”, mid(“this is test!”,9,2)=”te”

        現(xiàn)在要求編寫編碼函數(shù)Function TestEncode(SourceString),及一個(gè)解碼函數(shù)

        Function TestDecode(CodeString)。TestEncode(SourceString)是將SourceString

        串中非字母且非漢字且非數(shù)字的字符轉(zhuǎn)換為對(duì)應(yīng)Ansi編碼的十六進(jìn)制編碼!

        如:

        TestEncode(“Test.ASP?TestNum=100&TestStr=你好”)=

        “Test%2EASP%3FTestNum%3D100%26TestStr%3D你好”

        而TestDecode(CodeString)是將編碼的串還原,是TestEncode的逆函數(shù)。

        第五題:

        編寫一個(gè)星期的函數(shù)GetWeek(aDate)

        返回”星期一、星期二、星期三…”

        第六題:

        用ASP輸出九九乘法口決表的網(wǎng)頁(yè)

        輸出如下:

        1*1=1

        1*2=2 2*2=4

        1*3=3 2*3=6 3*3=9

        …

        要求編寫一個(gè)完整的ASP文件

        第七題到第九題

        已知SQL Server數(shù)據(jù)庫(kù)的有一個(gè)數(shù)據(jù)庫(kù)TestDB,學(xué)生表結(jié)構(gòu)如下:

        表名:Student

        字段名 類型 說明

        id int 自增1

        name varchar(16)

        sex char(1) ‘F’表示女性,’M'表示男性

        … …

        已知已經(jīng)定義了ADODB.Connection對(duì)象ConnTestDB已連接了上述的TestDB數(shù)據(jù)庫(kù)

        可以在以后的測(cè)試題中直接引用該對(duì)象.

        第七題:

        編寫ASP代碼,將Student中的人的姓名及性別列出來,并給統(tǒng)計(jì)學(xué)生人數(shù)如下:

        姓名 性別

        張三 男

        李四 男

        王五 女

        … …

        總共有100個(gè)學(xué)生

        第八題:

        在上述數(shù)據(jù)庫(kù)中,有一個(gè)表存放學(xué)生的得分的,結(jié)構(gòu)如下:

        表名:Score

        字段名 類型 說明

        StuID int 學(xué)生的ID值,關(guān)系是:Score.StuID=Student.ID

        Chinese int

        math int

        要求輸出內(nèi)容:

        姓名 語文 數(shù)學(xué) 總成績(jī)

        張三 60 100 160

        …

        請(qǐng)編寫實(shí)現(xiàn)上述功的ASP代碼

        第九題:

        已知:

        某一學(xué)生:陳六,男,語文80分,數(shù)學(xué)60分,現(xiàn)要求編寫ASP代碼

        將該學(xué)的數(shù)據(jù)插入數(shù)據(jù)庫(kù)中,分別插入到上述的兩個(gè)表Student,Score表中。

        網(wǎng)友提供的答案:

        ?

        第一題:Variant

        第二題:

        dim x,y

        if x=”" then

        x=1

        end if

        select case x

        case 1

        x=x+1

        case 2

        x=x+2

        end select

        for y=0 to x

        response.write y

        if y=2 then exit for

        next

        do

        x=x+1

        if x=4 then exit do

        loop while x<5

        第三題:

        運(yùn)行結(jié)果是:testA

        原因是:testA所附值的是一個(gè)全局變量TestString

        testB因?yàn)橛蠨im TestString這句定義,所以它所附值的只是一個(gè)局部變量。

        第四題:

        dim str

        str=”Test.ASP?TestNum=100&TestStr=你好”

        function TestEncode(f_Str)

        0Adim str_len

        dim for_x

        dim char

        dim ansi

        str_len=len(f_Str)

        for for_x=1 to str_len

        char=mid(f_Str,for_x,1)

        ansi=asc(char)

        if (ansi=>48 and ansi65 and ansi97 and ansi225) then

        TestEncode=TestEncode&char

        else

        TestEncode=TestEncode&”"&cstr(Hex(ansi))

        end if

        next

        end function

        function TestDecode(f_Str)

        0Adim str_len

        dim for_x

        dim char

        dim ansi

        str_len=len(f_Str)

        for for_x=1 to str_len

        char=mid(f_Str,for_x,1)

        if char=”" then

        ansi=mid(f_Str,for_x+1,2)

        TestDecode=TestDecode&chr(clng(“&H”&ansi))

        for_x=for_x+2

        else

        TestDecode=TestDecode&char

        end if

        next

        end function

        response.Write TestEncode(str)&””

        response.Write TestDecode(TestEncode(str))

        第五題:

        function GetWeek(aDate)

        if isdate(aDate) then

        GetWeek=weekdayname(WeekDay(aDate))

        end if

        end function

        response.Write GetWeek(“2002/1/3″)

        第六題:

        dim x,y

        for x=1 to 9

        for y=1 to x

        response.Write y&”*”&x&”=”&x*y&” ”

        if x=y then response.Write “”0D

        next

        next

        第七題:

        set rs=ConnTestDB.execute(“Select top 100 name,sex from Student order by id,sex”)

        response.Write “姓名 性別”

        while not rs.eof

        response.Write rs(“name”)&” ”&rs(“sex”)&””

        rs.movenext

        wend

        第八題:

        set rs=ConnTestDB.execute(“Select name,Chinese,math from Student,Score where StuID=ID”)

        response.Write “姓名 語文 數(shù)學(xué) 總成績(jī)”

        while not rs.eof

        response.Write rs(“name”)&” ”&rs(“Chinese”)&” ”&rs(“math”)&” ”&(rs(“Chinese”)+rs(“math”))&””

        rs.movenext

        wend

        第九題:

        dim StrudentID,StrudentName,StrudentSex

        StrudentName=”陳六”

        StrudentSex=”男”

        S_Chinese=80

        S_math=60

        Function yhsql(data)

        yhsql=”‘”&replace(data,”‘”,”””)&”‘”

        End Function

        ConnTestDB.execute “insert into Student (name,sex) value (“26yhsql(StrudentName)&”,”&yhsql(StrudentSex)&”) ”

        StrudentID=ConnTestDB.execute(“select max(id) as sid from Strdent where name=”&yhsql(StrudentName))(“sid”)

        ConnTestDB.execute “insert into Score (StuID,Chinese,math) value (“&S_Chinese&”,”&S_math&”) ”

        —————————————————————-

        第7到9題沒有經(jīng)過測(cè)試,可能會(huì)有語法上的錯(cuò)誤。

        還有,第9題的處理方法我個(gè)人認(rèn)為不是很妥當(dāng),請(qǐng)各位指點(diǎn)一下還有什么別的方法嗎?:)


      面試題相關(guān)文章:

      1.求職面試題目及答案大全

      2.經(jīng)典面試題

      3.競(jìng)聘上崗面試題及答案

      4.抗壓能力面試題及參考答案

      5.經(jīng)典情景面試題及參考答案

      4064187