2011年9月22日 星期四

字型設計

  • Helvetica, Helvetica Neue, Arial

    Helvetica 早在50年前誕生於瑞士,至今仍是最常使用的sans-serif字體,許多的知名品牌諸如美國航空、 Toyata等,皆是使用Helvetica做為指定字體。以Helvetica為原型而設計的字體十分多,大多數的設計師認為Ariel字體亦是Helvetica的仿製字體。

    helvetica

    arial

  • Verdana

    Verdana是一為Microsoft量身打造的字體,主要目的是為了設計出在螢幕適宜閱讀的最小字體。其字型比例以及較大的字元間距都大大增加了閱讀性,使其成為網頁設計的常用字型

    Verdana


  • Georgia
    Georgia是另一個於1993年為Microsoft量身打造的字型,其和Times New Roman有許多的相似處,由於另是較Times New Roman渾圓許多,所以也常被網頁設計師拿來取多已經過度使用的Times New Roman字型。

    georgia


  • Trebuchet MS

    又是另一個Microsoft所訂做的字型,1996年誕生,主要是為了打造另一個適宜網頁閱讀的字型,特別是適宜用在大標題(header)上

    trebuchet


  • Century Gothic

    Century Gothic和誕生於1991年,和Avant Garde Gothic十分類似,同樣適用於header,但用在內文上可能會有些雜亂的反效果。


    centurygothic


  • Lucida Sans Unicode, Lucida Grande

    Lucida Grande是Mac系統的通用字型,在sans-serif家族之中,是最具書法特色的字體。

    Lucida

  • Palatino
    Palatino於1948年由設計師Hermann Zapf所設計,據傳是以文藝復興的舊式字體為靈感發想,多年以後 Microsoft以Palatino為原型,設計出Book Antiqua字型

    palatino


  • Garamond, Baskerville, Caslon - these are the oldest typefaces on this list.

    這一組是最為古老的字型,Garamond於1540年由French king設計,並迅速的應用在於多印刷應用上,而此一字型的復興則是歸功於Apple。最近的哈利波特原裝書的封面也是使用此一字型。
    garamond

    baskerville

    caslon

  • Univers Condensed, Linotype Univers -
    Univers與Helvetica十分類似,由Adrian Frutiger於1956年設計。由於其字元間距所於來的簡潔感,此一字型被廣泛的使用在瑞士航空,德意志銀和,以及許多Apple的鍵盤上。

    univers

  • Myriad Pro
    在1990年初期誕生,主要是為了應用在Adobe軟體平台上。2002年以降,Myriad已取代Apple Garamond成為Apple的企業識別字型。

    myriad


  • Rockwell
    由於其獨特的收尾設計,Rockwell較適合應用在裝飾性的用途上,而非一般的內文中。


    rockwell


  • Warnock Pro
    以Adobe的創始人之一John Warnock的名字所命名,在Adobe CS 系列中常可看到它的蹤跡。

    warnock

  • FF DIN -
    “DIN” 為“Deutsche Industrie Norm”的縮寫,即德國工業標準,由荷蘭設計師設計,卻也承習德國的極簡風格,FF DIN也展其時尚的氣質。


    ffdin


  • Gotham -
    誕生於21世紀初,Gotham的幾何構圖以及簡單的設計也增加了其字型的閱讀性。

    gotham


  • Frutiger
    由Adrian Frutiger操刀設計,據傳設計師花了將近七年的時間才完成此一字型

    Frutiger


  • Dax Regular
    為21世紀字型史上相當年輕的一款字型,主要是由於在傳媒和廣告上的大量曝光才造成風行。UPS也使用此一字型做為企業識別。

    dax

  • Visual Studio 2008 環境設定

    工具>>匯入和匯出設定 >> 重設所有設定


    • Team Test
    • Visual Basic
    • Visual C#
    • Web程式開發設定

    • 一般開發設定

    Show/Hide div 區塊顯示隱藏

    Show/Hide div 區塊顯示隱藏 CSS HTML JavaScript 在 </head> 前貼上以下 Code

    <script> 
      function switchDisplay(item) { 
      var TargetArea = document.getElementById(item); 
      TargetArea.style.display = (TargetArea.style.display == 'block'?'none':'block'); 
    } 
    </script>
    


    連結寫法如下
    <a href="javascript:;" onclick="switchDisplay('DIV1');">Show/Hide 顯示/隱藏</a>

    要隱藏/顯示的區塊寫法如下 <DIV id="DIV1" style="display: none;"> Content 內容 </DIV>
    說明 一個連結對應一個區塊,綠色字的部份要互相對應到,若有多個區塊就直接另外命名,如:DIV2、DIV3 或是其他英文名稱皆可。(apple、orange……等等請隨意) 藍色字就是在網頁上顯示的部份,可自行變更內容。

    Footer貼緊下方

    #footer        
    {
    margin-bottom: 0em;
    text-align: center;
    }
    

    [ASP.NET]彈出式日期選擇視窗


    程式碼下載 PopupCalendar.zip

    這個範例示範了在 TextBox 控制項 click 後,彈出一個日期選擇視窗,當選取日期後按確定,就將選取的日期帶回 TextBox 中。 

    在這個程式中有二個頁面,Default.aspx 頁面放置一個 TextBox,Calendar.aspx 頁面即會日期選擇視窗。


    Defulat.aspx 頁面的程式碼如下 

    Default.aspx

        &lt;form id="form1" runat="server"&gt;

        &lt;div&gt;

            &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt;&lt;/div&gt;

        &lt;/form&gt;

     Default.aspx.vb

    01 Partial Class _Default

    02     Inherits System.Web.UI.Page

    03 

    04     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 

    05         Dim sScript As String 

    06         Dim sUrl As String 

    07  

    08         '日期輸入的頁面,將 TextBox 以 TextBoxId 網址參數傳給日期頁面 

    09         sUrl = "Calendar.aspx?TextBoxId=" &amp; TextBox1.ClientID 

    10         sScript = "window.open('" &amp; sUrl &amp; "','','height=315,width=350,status=no,toolbar=no,menubar=no,location=no','')" 

    11         TextBox1.Attributes("onclick") = sScript 

    12     End Sub

    13 End Class



    Calendar.aspx 頁面的程式碼如下

    Calendar.aspx

        &lt;form id="form1" runat="server"&gt;

        &lt;div&gt;

            &lt;asp:Calendar ID="Calendar1" runat="server"&gt;&lt;/asp:Calendar&gt;

            &lt;asp:Button ID="btnOK" runat="server" Text="確定" /&gt;

        &lt;/div&gt;

        &lt;/form&gt;





    Calendar.aspx.vb

    01 Partial Class Calendar

    02     Inherits System.Web.UI.Page

    03 

    04     Protected Sub btnOK_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOK.Click 

    05         Dim sScript As String 

    06         Dim sTextBoxID As String 

    07  

    08         '取得要輸入日期的 TextBox 

    09         sTextBoxID = Me.Request.QueryString("TextBoxId") 

    10         '將日期設給 TextBox,並將視窗關閉 

    11         sScript = "opener.window.document.getElementById('" &amp; sTextBoxID &amp; "').value='" &amp; Calendar1.SelectedDate.Date &amp; "';" 

    12         sScript = sScript &amp; "window.close();" 

    13         Me.ClientScript.RegisterStartupScript(Me.GetType(), "_Calendar", sScript, True) 

    14     End Sub

    15 End Class

    CodeFile 與 CodeBehind 的差別

    ASP.NET 2.0之後應用CodeFile 來指定程式碼

    用CodeFile指定會動態編譯(ie. 無須發行網站)

    用CodeBehind 需要已編譯好的cs檔
    ---
    *.net1.1-&gt;.net2.0轉換

    *closed CodeBehind versus CodeFile

    Description

    I noticed recently that the N2CMS project uses CodeBehind="..." (asp.net version 1) to reference codebehind files instead of CodeFile="..." (asp.net version 2+). This makes it impossible to pass the web project validation in visual studio 2008 since the codebehind partial classes can't see the parts on the forms unless the parts are re-declared as protected variables in code-behind (which they aren't always and does not always work). The easy way to fix this is to search and replace CodeBehind for CodeFile across the project and then fix the duplicate variables and inaccessible classes. This isn't a critical issue but I thought that I'd throw it out there in case somebody was having the same problem as me. I could submit a patch if desired later this week / next week.

    100年十大傑出青年-台大資訊工程學系 林智仁教授

    http://www.csie.ntu.edu.tw/~cjlin/
    http://www.iicm.org.tw/communication/c1_4/page02.html

    ASP.NET - 兩個網頁相互傳值

    http://blog.xuite.net/sugopili/computerblog/13078151

    當 ASP.NET遇到 Oracle問題


    國內常用的資料庫有 DbaseIII、Lotus、Excel、Access、SQL Server、Oracle、MySQL、Informix、Sybase、DB2、Ingres等等,其中 .NET連接 Excel、Access、SQL Server最常見、範例又多,而 Oracle只能在網頁上找尋答案,沒有專書做介紹,至於其他資料庫沒有接觸,不知情況。
    (一)SQL Server與 Oracle連線字串
        SQL Server:IP位址為127.0.0.1,資料庫名稱為ABC
        Oracle:服務命名為DEF









    使用System.Data.OracleClient,可參考 oracle設定
    OLEDB For ASP.NET:可參考 oracle_oledb設定
    IIS那台電腦想透過 .NET讀寫 Oracle資料庫,需要安裝 Oracle Client(或參考『客戶端不安裝的Oracle情況下連接數據庫方法』一文),Oracle Client軟體有提供〔Net Manager〕程式,讓使用者可以自定連 Oracle的服務命名。
    客戶端不安裝的Oracle情況下連接數據庫方法:大陸網站,前提要有一台已安裝過 Oracle Client軟體。
    (二)透過 SqlDataSource讀寫 Oracle資料庫
        SqlDataSource對 SQL Server使用的參數為@,但對 Oracle使用參數,它所認定的符號為
        例如對資料表A(有B、C兩欄位)做新增一筆資料動作
    Imports System.Data
    Imports System.Data.SqlClient
    Imports System.Data.OracleClient
    Imports System.Web.Configuration
    SQL Server寫法:
        Dim SqlDataSource1 As New SqlDataSource
        '取得 Web.config 檔的資料連接設定
        SqlDataSource1.ConnectionString = WebConfigurationManager.ConnectionStrings("SQL_Server").ConnectionString
        SqlDataSource1.InsertCommandType = SqlDataSourceCommandType.Text
        SqlDataSource1.InsertCommand = "insert into A(B,C) values (@B1,@C1)"
        SqlDataSource1.InsertParameters.Clear()
        SqlDataSource1.InsertParameters.Add("B1",設定值)
        SqlDataSource1.InsertParameters.Add("C1",設定值)
        SqlDataSource1.Insert()     '執行對資料庫做 Insert動作
    Oracle寫法:透過 System.Data.OracleClient
        Dim SqlDataSource1 As SqlDataSource
        SqlDataSource1 = New SqlDataSource()
        SqlDataSource1.ConnectionString = WebConfigurationManager.ConnectionStrings("oracle").ConnectionString
       SqlDataSource1.ProviderName = WebConfigurationManager.ConnectionStrings("oracle").ProviderName
        SqlDataSource1.InsertCommandType = SqlDataSourceCommandType.Text
        SqlDataSource1.InsertCommand = "insert into A(B,C) values (:B1,:C1)"
        SqlDataSource1.InsertParameters.Clear()
        SqlDataSource1.InsertParameters.Add("B1",設定值)
        SqlDataSource1.InsertParameters.Add("C1",設定值)
        SqlDataSource1.Insert()     '執行對資料庫做 Insert動作
    (三)其他問題:
    1. 使用 SqlDataSource配合 GridView對 Oracle資料庫進行資料的更新或刪除時,會發生『ORA-01036: 變數名稱?號碼無效』錯誤訊息。
       解決方式:ORA-01036:非法變量名/編號(大陸網站)
    2. 使用 SqlDataSource時,出現『在建立連接至伺服器時發生錯誤。當連接至 SQL Server 2005 時,失敗的原因可能是,在預設設定下,SQL Server 不允許遠端連接。(provider: 具名的管線提供者, error: 40 - 無法開啟至 SQL Server 的連接)』錯誤訊息。
       解決方式: 由於使用 SqlDataSource連接 Oracle時,沒有指定 ProviderName,則 SqlDataSource會預設為 providerName="System.Data.SqlClient" 模式,所以才會有錯誤訊息的產生。因此,需要將 ProviderName設定為 System.Data.OracleClient。
    3. 其他參考資料:
       KB-Oracle 9i NVarchar求生守則
       .net 2.0訪問 Oracle與 Sql Server的差異,注意事項,常見異常
    2009/07/08 新增部份:
    Statement Tracer for Oracle簡介

    轉:http://blog.xuite.net/sugopili/computerblog/22869008

    簡易寄信程式

    string mail_to = "xxx";//逗號做區隔
    string mail_subject = "xxx";
    string mail_from = "xxx";
    string smtpServer = "xxx";
    string mail_body = "xxx";
           System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
           message.From = new System.Net.Mail.MailAddress(mail_from);
           message.To.Add(new System.Net.Mail.MailAddress(mail_to));
           message.Subject = mail_subject;
           message.Body = mail_body;
           message.IsBodyHtml = true;
           System.Net.Mail.SmtpClient emailClient = new System.Net.Mail.SmtpClient(smtpServer);
           emailClient.Send(message);
    

    ASP.NET 取得 Client端使用者相關資訊(AD, Local)