Session variables lost after the call of Response.Redirect method
摘要:From: https://forums.asp.net/t/2096848.aspx?Session+variables+lost+after+the+call+of+Response+Redirect+method [问题] Hi Everyone, In my asp.net applicat
阅读全文
posted @
2018-09-14 16:56
今夜太冷
阅读(509)
推荐(0) 编辑
HttpWebRequest抓取网页数据返回异常:远程服务器返回错误: (503) 服务器不可用
摘要:解决方法: HttpWebRequest request = (HttpWebRequest)WebRequest.Create(webURL); //声明一个HttpWebRequest请求 request.Timeout = 30000; //设置连接超时时间 r...
阅读全文
posted @
2017-12-14 16:19
今夜太冷
阅读(5844)
推荐(0) 编辑
HttpWebRequest: Remote server returns error 503 Server Unavailable
摘要:I have a client server application written in C# .Net 2.0. I have had the client/server response/request code running for 4 years(!). Recently, on a specific machine, the client can not connect to s...
阅读全文
posted @
2017-12-14 16:02
今夜太冷
阅读(792)
推荐(0) 编辑
IIS中的application总是报404错误
摘要:在IIS的一个站点下面建立了一个application,访问其中页面的时候总是报404(找不到页面)的错误,哪怕是最简单只包含一个简单html页面的application也是如此,而其他同级的application就没有这个问题, 怎么回事那? 【解决方法】 原来这是其中的一个load balance服务器,访问页面的时候,请求可能发送到另一个服务器上去了,而另一个服务器上由于没有对应的页面,...
阅读全文
posted @
2017-11-30 16:56
今夜太冷
阅读(223)
推荐(0) 编辑
Authentication and Authorization in ASP.NET Web API
摘要:You've created a web API, but now you want to control access to it. In this series of articles, we'll look at some options for securing a web API from unauthorized users. This series will cover both...
阅读全文
posted @
2017-10-19 17:08
今夜太冷
阅读(470)
推荐(0) 编辑
正则表达式:将图片的相对网址补全。
摘要:Q: I have an image tag with a src and I want to prepend a website url onto the src but only if it doesn't start with http://. so far I have content.replace(/(<img *src=")(.*?)"/, '$1' + this.websiteUr...
阅读全文
posted @
2017-05-26 11:23
今夜太冷
阅读(748)
推荐(0) 编辑
为什么有的需要安全连接的的application只有开Fiddler才好用?
摘要:Help! Running Fiddler Fixes My App??? Over the years, the most interesting class of support requests for Fiddler are of the form: "My application or website is failing, but when I try to capture a r...
阅读全文
posted @
2017-05-08 16:53
今夜太冷
阅读(1035)
推荐(0) 编辑
如何防止XSRF攻击
摘要:XSRF全称是 cross-site request forgery(跨站点请求伪造),也称为CSRF,是一种常见的web攻击方式。 攻击形式描述如下: 1.用户登录并访问一个正常的站点 http://www.biz.com; 2.在同一个浏览器实例下,用户打开了恶意网站 http://www.bad.com;(至于用户怎么会打开这个恶意网站,可能是恶意网站通过一些链接或者垃圾邮件等等形式诱骗用户...
阅读全文
posted @
2017-03-21 16:15
今夜太冷
阅读(627)
推荐(0) 编辑
How to Redirect in ASPNET Web API
摘要:You could set the Location header: public HttpResponseMessage Get() { var response = Request.CreateResponse(HttpStatusCode.Found); response.Headers.Location = new Uri("http://www.google.com"...
阅读全文
posted @
2017-03-08 15:14
今夜太冷
阅读(358)
推荐(0) 编辑
WCF Misconfiguration: Security Not Enabled
摘要:Abstract: No transport or message security has been defined. Explanation: Applications that transmit messages without transport or message security cannot guarantee the integrity or confidentiality of...
阅读全文
posted @
2016-12-20 16:29
今夜太冷
阅读(753)
推荐(0) 编辑
WCF Misconfiguration: Insufficient Audit Failure Handling
摘要:Abstract: The program is configured not to generate an exception when it fails to write to an audit log. Explanation: If WCF is configured not to throw an exception when it is unable to write to an au...
阅读全文
posted @
2016-12-20 16:21
今夜太冷
阅读(617)
推荐(0) 编辑
ASP.NET Misconfiguration: Excessive Session Timeout
摘要:Abstract: An overly long authentication timeout gives attackers more time to potentially compromise user accounts. Explanation: The longer a session stays open, the larger the window of opportunity an...
阅读全文
posted @
2016-12-20 16:15
今夜太冷
阅读(557)
推荐(0) 编辑
ASP.NET Misconfiguration: Missing Error Handling
摘要:Abstract: An ASP .NET application must enable custom error pages in order to prevent attackers from mining information from the framework's built-in error responses. Explanation: ASP .NET applications...
阅读全文
posted @
2016-12-20 16:08
今夜太冷
阅读(587)
推荐(0) 编辑
ASP.NET Misconfiguration: Request Validation Disabled
摘要:Abstract: Use the ASP.NET validation framework to prevent vulnerabilities that result from unchecked input. Explanation: Unchecked input is the leading cause of vulnerabilities in ASP.NET applications...
阅读全文
posted @
2016-12-20 16:06
今夜太冷
阅读(630)
推荐(0) 编辑
ASP.NET Misconfiguration: Debug Information
摘要:Abstract: Debugging messages help attackers learn about the system and plan a form of attack. Explanation: ASP .NET applications can be configured to produce debug binaries. These binaries give detail...
阅读全文
posted @
2016-12-20 16:01
今夜太冷
阅读(984)
推荐(0) 编辑
MIME Sniffing
摘要:Abstract: The web.config file does not include the required header to mitigate MIME sniffing attacks Explanation: MIME sniffing, is the practice of inspecting the content of a byte stream to attempt t...
阅读全文
posted @
2016-12-20 15:22
今夜太冷
阅读(1209)
推荐(0) 编辑
web.config中的HttpCookie.HttpOnly属性
摘要:Abstract: The program does not set the HttpCookie.HttpOnly property to true. Explanation: The default value for the httpOnlyCookies attribute is false, meaning that the cookie is accessible through a ...
阅读全文
posted @
2016-12-20 14:45
今夜太冷
阅读(1994)
推荐(0) 编辑
Web API的Log问题
摘要:建立了一个Web API项目,在WebApiConfig.cs中已经启用了Tracing. config.EnableSystemDiagnosticsTracing(); 同时web.config中也已经配置了TextWriter. ...
阅读全文
posted @
2016-12-09 16:12
今夜太冷
阅读(800)
推荐(0) 编辑
System.Net.Http.Formatting的nuget版本冲突问题
摘要:已经添加了nuget Microsoft.AspNet.WebApi.Client 调用System.Net.Http.HttpClient.PostAsJsonAsync的时候报如下的错误: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, Pub...
阅读全文
posted @
2016-06-17 17:40
今夜太冷
阅读(7745)
推荐(0) 编辑
Nuget出现错误怎么办?
摘要:Go to the packages folder in the Windows Explorer and delete it. Open Visual Studio and Go toTools>Library Package Manager>Package Manager Settingsand under the Package Manager item on the le...
阅读全文
posted @
2016-06-16 16:42
今夜太冷
阅读(439)
推荐(0) 编辑