之前有作一個 MVC的 portal,使用者是打入 IP如 192.168.xx.xx/portal的方式連結的,在 IIS的是設定虛擬目錄的方式,而最近要導 AD了,因為有 DNS所以同仁希望可以用 portal.xxxx.com的方式就可以連結,而且之前 IP的方式也可以保留,作法請參考下列網站
http://www.flag.com.tw/book/cento-5105.asp?bokno=F6201&id=164
主要作法是再新增一個 IIS網站 port也是 80,網站目錄指定到虛擬目錄的那一個,但是要再多作一個動作,就是在新增的網站設定 繫結,要指定這個新網站 IP對應指定一個 domain name,這樣就可以。
用 browser打開時如果有碰到 呼叫 LoadLibraryEx (於 ISAPI 篩選器 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\\aspnet_filter.dll" 上) 失敗
記得把 ISAPI上把多的 \拿掉即可
2015年11月3日 星期二
2015年6月24日 星期三
IIS 7連結網路分享目錄
IIS 無法直接存取已建立網路磁碟机,作法如下
之前也寫過的文章
- 建立 本機(server) 使用者, 在另外一台要作分享目錄的電腦也建立相同帳號、密碼,並把分享目錄指定給這個帳號,給予 read write權限
- 設定本機(server)目錄權限
因為使用 aps.net mvc5 且 64位元,建議下面兩個目錄都要設定 C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files - 至 iis 7,其應用程式上新增一個虛擬目錄,指定分享目錄並輸入帳號、密碼
- 修改 Web.config檔 <web.system>內加入<identity impersonate=" true" userName="*****" password=" ******" />
- 程式取得目錄名稱 string default_root = Server.MapPath("../虛擬目錄名稱" );
之前也寫過的文章
IIS 7以上如何執行執行檔 exe, bat
參考文件:Foo.cmd won't output lines in process (on website)
System.Diagnostics.Process does not work on IIS 7
目前有個需求需要在 Asp.net MVC網頁上按個連結就可以直接把標籤列印出來,所以要使用 Process這個類別
寫法大同小異,如下
System.Diagnostics.Process does not work on IIS 7
目前有個需求需要在 Asp.net MVC網頁上按個連結就可以直接把標籤列印出來,所以要使用 Process這個類別
寫法大同小異,如下
string command = string .Format("tscgin.exe {0} {1}", "mo_print.ini", fileName);
Process p = new Process();
// Redirect the output stream of the child process.
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.WorkingDirectory = "c:\somewhere"
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.Arguments = "/c " + command;
p.Start();
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
但在 IIS和本機(或 Server)目錄需要設定權限的動作,如下
- 建一個新目錄存放 exe or bat file,並設定權限 NetworkService或建立一個帳號具有執行、寫入、讀取
- 至 IIS 找出應用程式的 Application Pool後點選"進階應用",找到 "識別"選項,使用者選擇 NetworkService或你自己建立的新帳號即可
訂閱:
文章 (Atom)