后台日志管理和网站信息设计(7)
来源:未知 责任编辑:责任编辑 发表时间:2014-04-20 03:40 点击:次
14: //操作系统版本
15: string OSVersion = Environment.OSVersion.ToString();
16: //iis版本
17: string IISVersion = HttpContext.Current.Request.ServerVariables["SERVER_SOFTWARE"];
18: //服务器端口
19: string ServerPort = HttpContext.Current.Request.ServerVariables["SERVER_PORT"];
20: //虚拟目录绝对路径
21: string RealDirectory = HttpContext.Current.Request.ServerVariables["APPL_PHYSICAL_PATH"];
22: //https支持
23: string SupportHttps = HttpContext.Current.Request.ServerVariables["HTTPS"];
24: //session总数
25: string SessionCount = HttpContext.Current.Session.Keys.Count.ToString();
26:
27: StringBuilder Json = new StringBuilder();
28: StringWriter sw = new StringWriter(Json);
29: using (JsonWriter jsonWriter = new JsonTextWriter(sw))
30: {
31:
32: jsonWriter.Formatting = Formatting.Indented;
33:
34: jsonWriter.WriteStartObject();
35: //网站信息
36: jsonWriter.WritePropertyName("MachineName");
37: jsonWriter.WriteValue(MachineName);
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>