發表文章

目前顯示的是 4月, 2017的文章

ASP.NET MVC RouteConfig 設定讓瀏覽器能取得根目錄的 html

讓瀏覽器能使用靜態檔案,例如: html, js, css 其它格式必須再加設 MIME type public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute(""); // 加入這一行即可 //routes.RouteExistingFiles = true; routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); } } MIME 的設定方式: 以加設一個 .woff 字型為例: <system.webServer> ... <staticContent> <remove fileExtension=".woff" /> <mimeMap fileExtension=".woff" mimeType="application/font-woff" /> </staticContent> </system.webServer>

查出哪個程式佔用 port 443

圖片
今天要使用 IIS 開 443 port 測試 設定好確無法啟動網站,所以查了語法 netstat -ano|findstr "0.0.0.0:443" 查到pid 4836 正在使用 port 然後再查一下 pid 4836 是什麼程式 tasklist|findstr "4836" 發現是 vmware-hostd.exe 正在使用,透過下列步驟關閉 It's easier to change the port in VMware Workstation: Edit > Preferences; Shared VMs tab; Disable; Change port; Enable. Done.