顯示具有 HTML 標籤的文章。 顯示所有文章
顯示具有 HTML 標籤的文章。 顯示所有文章

2013年11月5日 星期二

使用Google 雲端硬碟放置網頁連結可直接下載的檔案

1.將檔案放到Google雲端硬碟後
   在共用設定將檔案的權限由私人設為公開
   這個畫面會得到一個共用連結


2.將共用連結拿來修改
原來應該是類似
https://drive.google.com/file/d/0B66PlkYn12VKcG5iLS1ZNmhsSU0/edit?usp=sharing

將紅色部分接在 https://googledrive.com/host/ 之後
得到https://googledrive.com/host/0B66PlkYn12VKcG5iLS1ZNmhsSU0

這樣就可以透過URL Link 來使用css或js

2013年9月16日 星期一

IIS6&7 handler 開發

最近試著寫了一個簡單的handler for iis6&7
紀錄一下免得以後忘了

1. Visual Studio 新增一個 MyIIS7Handler 類別庫的專案

2.新增System.Web 的參考
3.新增以下的Code

namespace MyIIS7Handler
{
    public class MyHandler : IHttpHandler
    {
        public bool IsReusable
        {
            get { return false; }
        }

        public void ProcessRequest(HttpContext context)
        {
            DateTime dt;
            dt = DateTime.Now;

            context.Response.Write(String.Format("<h1>{0}</h1>",dt.ToLongTimeString()));
        }
    }
}

4.將程式編譯好放到IIS Server上(iis7的設定方式所參考的網頁都有說明, 這裡僅記錄iis6)
先將dll 放到網站的bin目錄下


5.網站的Web.Config 新增以下設定於<system.web>內
目的是讓副檔名是tm的檔案都透過我們的handler來執行

        <httpHandlers>
   <add verb="*" path="*.tm" type="MyIIS7Handler.MyHandler"/>
        </httpHandlers>

6.還要設定副程式讓aspnet_isapi來執行我們的 dll

參考網頁:
How To Create an ASP.NET HTTP Handler by Using Visual C# .NET
INFO: ASP.NET HTTP 模組與 HTTP 處理常式概觀
Migration of ASP.NET app from IIS6 to IIS7 (7.5)
Develop a Native C\C++ Module for IIS 7.0
Developing a Module Using .NET
Developing IIS7 modules and handlers with the .NET framework

2012年9月6日 星期四

apache 整合其他WEB Server

在Apache中修改httpd.conf文件,启用proxy_module和proxy_http_module:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

然后在Apache的httpd.conf文件中增加如下几行:

ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/

2012年9月5日 星期三

判斷瀏覽器動態載入資料

<!--[if IE]>內容<![endif]-->
內容只有 IE 會顯現。
<!--[if IE 7]>內容<![endif]-->
內容只有 IE7 會顯現。
<!--[if lt IE7]>內容<![endif]-->
內容只有比 IE7 更舊會顯現。
<!--[if !IE]>-->內容<!--<![endif]-->
內容除了 IE 以外的瀏覽器會顯現。
參考連結 http://boohover.pixnet.net/blog/post/12309095