标签:tpc uifont public reg turn ase startup ledir ret
Web地址:
JS:
var baseUrl = window.location.host;//不带http:// 结果为: localhost:8033
asp.net:
string host = HttpContext.Current.Request.Url.Host; string baseUrl = host+":"+port; //也不带 http://
实际地址:
string FileDir=HttpContext.Current.Request.ApplicationPath.ToString();//根路径
Form:
string path = Application.StartupPath.ToString() + "\aa.exe";
Web 获取实际路径
1.controller中
Server.MapPath("/Plugin/layuifont/icon_data.json");
E:\source\suyuan\SuYuan.Web\Plugin\layuifont\icon_data.json
2.非Controller中获得文件物理路径
/// <summary> /// </summary> public static string GetMapPath(string path) if (HttpContext.Current != null) return HttpContext.Current.Server.MapPath(path); else return System.Web.Hosting.HostingEnvironment.MapPath(path); }
标签:tpc uifont public reg turn ase startup ledir ret
原文地址:https://www.cnblogs.com/dennyw/p/14235107.html