![在Notepad++中,如何將目前的html檔案當作url啟動?](https://rvso.com/image/1395278/%E5%9C%A8Notepad%2B%2B%E4%B8%AD%EF%BC%8C%E5%A6%82%E4%BD%95%E5%B0%87%E7%9B%AE%E5%89%8D%E7%9A%84html%E6%AA%94%E6%A1%88%E7%95%B6%E4%BD%9Curl%E5%95%9F%E5%8B%95%EF%BC%9F.png)
我有一個js
運行節點伺服器程式碼的檔案。 (透過notepad++
使用NPPExec
)
好的 - 現在伺服器已啟動並正在監聽http://localhost:3030
但是,我有一個資源管理器樹的左窗格:
目標 :
- 取目前檔名
- 計算其相對位置
c:\program Files (x86)\nodejs\public folder
- 前置
http://localhost:3030
- 跑步
chrome.exe "http://localhost:3030/" + "/angularjs-book-master/chapter2/amail/index.html"
所以,我想運行這個:
NPP_RUN chrome.exe http://localhost:3030/(current file relative to nodejs
民眾folder)
注意:我想將其作為網址運行。
所以在我的例子中我想要:
NPP_RUN chrome.exe http://localhost:3030/angularjs-book-master/chapter2/amail/index.html
index.html
目前顯示的文件在哪裡。
但問題是我不僅有/angularjs-book-master/chapter2/amail/index.html
我有滿的值 哪個是$(FILE_NAME)
哪個是
file:///C:/Program%20Files%20(x86)/nodejs/public/angularjs-book-master/chapter1/order-form.html
我不需要整個字串。一個能從中削減的解決方案file:///C:/Program%20Files%20(x86)/nodejs/public/
也很好。
另外,斜線應該是向後。
簡而言之:
我有NPP_RUN "chrome.exe" $(FILE_NAME)
但這運行:
chrome.exe file:///C:/Program%20Files%20(x86)/nodejs/public/angularjs-book-master/chapter2/amail/index.html
但我想要僅有的這:(注意斜線)
chrome.exe http://localhost:3030/angularjs-book-master/chapter2/amail/index.html