c# cs程序与bs程序交互
2 回答
HUWWW
TA贡献1874条经验 获得超12个赞
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | /// <summary> /// 判断是否是web程序 /// </summary> /// <returns>true:是,false:winform</returns> public bool IsWebApp() { bool flag = false; if (HttpContext.Current != null) { flag = true; } //否则是winform程序 return flag; } |
开心每一天1111
TA贡献1836条经验 获得超13个赞
HttpWebRequest HttpWReq = (HttpWebRequest)WebRequest.Create("XXXXX");
HttpWReq.KeepAlive = false;
HttpWReq.Method = "Post";
HttpWReq.CookieContainer = new CookieContainer();
HttpWReq.CookieContainer.Add(new Cookie("name", "value"));
HttpWebResponse HttpWResp = (HttpWebResponse)HttpWReq.GetResponse();
HttpWResp.Close();
- 2 回答
- 0 关注
- 824 浏览
添加回答
举报
0/150
提交
取消