• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • ASP.NET多語言支持

    發表于:2007-06-30來源:作者:點擊數: 標簽:
    br> ASP .net 支持多種語言,它的缺省語言將是:visual basic而不是 VB script,這意味著我們可以擺脫VBScript的語言限制,我們的代碼將是編譯后運行的(而不是原來的解釋執行)。 Visual Basic 讓VBScript 一邊去吧。ASP現在全部用成熟的VB語言來書寫。感覺
         br>   ASP.net支持多種語言,它的缺省語言將是:visual basic而不是VBscript,這意味著我們可以擺脫VBScript的語言限制,我們的代碼將是編譯后運行的(而不是原來的解釋執行)。
      
        Visual Basic
      
        讓VBScript 一邊去吧。ASP現在全部用成熟的VB語言來書寫。感覺還不錯,不是嗎?不過,VB有了一些改動。VB中的主要改變,不再有Set & Let,不再有缺省屬性,Parenthesis現在被稱為SUBS,Arguments需通過缺省設置來實現 BYVAL,Integer 為32位,Long為64位,And" and "Or“ 省略了,通過上面的清單不難發現,VB的許多變動是有實際意義的,也是有明顯進步的。
      
        不過,通過上面這些變動卻不能改變一個事實,你許多現有的代碼將不會正常運作。
      
        我們先看個完整的查詢的例子,這個例子也顯示了當查詢顯示沒有紀錄返回和如何檢測返回NULL數據的情況
      
        $#@60;%@ OutputCache duration="240"%$#@62;
      $#@60;%--
      the above OutputCache directive is pretty slick
      It means that for 240 seconds (4 minutes) the page will only read the database once
      only the first user hitting it forces a database read
      --%$#@62;
      $#@60;%@ Import Namespace="System.Data" %$#@62;
      $#@60;%@ Import Namespace="System.Data.ADO" %$#@62;
      
        $#@60;script language="VB" runat="server"$#@62;
      Sub Page_Load(Src As Object, E As EventArgs)
        Dim DS As DataSet
        Dim MyConnection As ADOConnection
        Dim MyCommand As ADODataSetCommand
        dim strconn as string
        dim strSQL as string
      
        strconn="DSN=student;uid=student;pwd=magic;database=student"
      
        strSQL="select * from Publishers where state="NY""
      
        MyConnection = New ADOConnection(strconn)
        MyCommand = New ADODataSetCommand(strSQL,MyConnection)
      
        DS = new DataSet()
        MyCommand.FillDataSet(ds, "Publishers")
      
        MyDataGrid.DataSource=ds.Tables("Publishers").DefaultView
        MyDataGrid.DataBind()
      End Sub
      
      $#@60;/script$#@62;
      $#@60;html$#@62;$#@60;head$#@62;
      $#@60;title$#@62;Grid of New York Data$#@60;/title$#@62; > $#@60;/head$#@62;
      $#@60;body bgcolor="#FFFFFF"$#@62;
      $#@60;h3$#@62;$#@60;font face="Verdana"$#@62;New York Data$#@60;/font$#@62;$#@60;/h3$#@62;
      
      $#@60;ASP:DataGrid id="MyDataGrid" runat="server"
      Width="100%"
      BackColor="white"
      BorderColor="black"
      ShowFooter="false"
      CellPadding=3
      CellSpacing="0"
      Font-Name="Verdana"
      Font-Size="8pt"
      Headerstyle-BackColor="lightblue"
      Headerstyle-Font-Size="10pt"
      Headerstyle-Font-Style="bold"
      MaintainState="false"
      /$#@62;
      $#@60;/body$#@62;$#@60;/html$#@62;
      
        C# (C Sharp)
      
        C # 非?!翱帷?,這兒有個雙關語,在微軟的內部代碼名稱里,C#就被稱為 “酷”(具體語法將另文介紹)。如果你是用VB的開發者,就沒有必要換用其它的語言,但是用C++ 的開發者會高興得不得了。我們將在后面看到關于C#的例子
      
        Jscript
      
        如我所知,這也是以前老版本的Jscript。如同VB一樣,Jscript也從NGWS runtime中得益不少,并且它也是被編譯過的。
      

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>