Skip to main content

Posts

Showing posts from February, 2014

IIS and Windows 2012 Notes

Shut down IIS: net stop was /y Start IIS: net start w3svc Show active http bindings: netsh http show servicestate Config file schemas can be found here: C:\Windows\system32\inetsrv\config\schema\IIS_schema.xml Internet Information Services: What’s New in Window Server 2012 R2

Windows 8 Keyboard Shortcuts

http://www.pcworld.com/article/2012885/20-must-know-windows-8-tips-and-tricks.html The Windows key + I opens the settings menu, giving you quick access to the Control Panel, Personalization, and your Power button, among other features. The Windows key + Pause opens the system properties page to show you a quick rundown of your specs.

A simple IIS HTTP module to log request headers and post data

This is a simple http module that hijacks the incoming request and logs it to a file. Using this module prevents the application from getting the post data because the input stream can only be read once. With .NET 4.0 the module could be much smaller, and could allow the application to read the data. To compile this, create a new "Class Library" application called PostDataLogger. Most of this class is pieced together from stolen code (stack overflow, etc.) using System; using System.IO; using System.Web; /// /// Dump PostDataLogger.DLL in your bin, and put this in your web.config inside of /// /// /// /// public class SimpleLogger : IHttpModule { private HttpApplication _ctx; public void Init(HttpApplication context) { _ctx = context; context.BeginRequest += new EventHandler(Context_BeginRequest); } void Context_BeginRequest(object sender, EventArgs e) { string GUID = Guid.NewGuid().ToString(); string filename = @"d:\temp\adeber