zoukankan
html css js c++ java
如何用c#获得当前站点的根路径
public
string
GetRootPath()
{
//
是否为SSL认证站点
string
secure
=
HttpContext.Current.Request.ServerVariables[
"
HTTPS
"
];
string
httpProtocol
=
(secure
==
"
on
"
?
"
https://
"
:
"
http://
"
);
//
服务器名称
string
serverName
=
HttpContext.Current.Request.ServerVariables[
"
Server_Name
"
];
string port = HttpContext.Current.Request.ServerVariables["SERVER_PORT"];
//
应用服务名称
string
applicationName
=
HttpContext.Current.Request.ApplicationPath;
return httpProtocol + serverName + (port.Length > 0 ? ":" + port : string.Empty) + applicationName;
}
愿一路奔跑不退缩,到目前一直从事.Net的B/S,C/S企业应用研发
查看全文
相关阅读:
Codeforces A. Bear and Big Brother
codeforces A. In Search of an Easy Problem
c#判断两个对象和对象中的属性是否相同(以及记录对象中的哪些字段,和详细的改变情况)
生成随机字符串
SQL语句计算距离今天生日还差几天
sqlServer 获取最新的一条数据
c#所有部门及其下所部门生成树形图(递归算法获取或键值对方式获取)
根据中文名,自动生成首字母的拼音码或拼音码(两种方法)
char/varchar/nvarchar的区别
c#中ofType的用法
原文地址:https://www.cnblogs.com/syveen/p/292489.html
最新文章
jQuery.qrcode.js客户端生成二维码,支持中文并且可以生成LOGO
JavaScript 生成二维码(修改qrcode.js添加icon支持)
js修改url不刷新页面
原生js删除、添加、查找、替换元素
解决 vue+ts通过Vue.prototype绑定的属性方法,能够调用到,但是编译报错
js实现复制到剪切板
axios使用delete方法的params和data传参
深入理解Thread构造函数
PAT1001~1005AC代码
快速认识线程
热门文章
Anaconda环境搭建
Uncaught TypeError: window.showModalDialog is not a function
二、实现算数加减
文本编辑器
用Java做一个跳一跳辅助
Nessus虚拟机的几个问题解决办法
(BruteForce)暴力破解经典题目总结
磁盘调度算法
UVa 10474 Where is the Marble?
Java开发者使用C++写程序踩的坑
Copyright © 2011-2022 走看看