I’ve seen this on several site, and I also have this written down on pieces of paper all over my office, both at home and at work, so I figure it’s about time I get it somewhere more digital where I always know where I have it, as well as share this knowledge with other people who come by. For this example I assume that Windows is installed on the C-drive, and you want to move the users folder to the D-drive. To make sure you’re not touching files that are in use, boot from the Windows installation disc (or USB) and start a command prompt. The instructions here are for Windows 7, but they’re not very different from Windows 8.x: First you need to […] Read more
Recently I encountered a problem using webservices in .Net. At irregular intervals the code suddenly threw the following exception when calling a webservice: System.Net.WebException: The operation has timed out There was nothing magical in the code around the calls to the webservice where it was handled in the usual fashion: WebserviceClass ws = new WebserviceClass(); ws.Foo(); When the code reached ws.Foo() it just waited there for over a minute before throwing the previously mentioned exception. Since using webservices is extremely streamlined and standardized in Visual Studio I initially thought the problem had to lie somewhere else than my application, like maybe there were networking issues or the ISS server that hosted the webservice had some problems. When troubleshooting all of the above and nothing panned […] Read more
I had the need to programatically print an XPS file, but a couple of hours of Google searches only returned examples of how to print TO an XPS file. It was extremely difficult to find how to send a XPS file to an actual physical printer. Eventually something turned up and the solution seemed to be the XpsDocument class. Look at this simplified example to see how easy it turned out to be: PrintDialog dlg = new PrintDialog(); XpsDocument xpsDoc = new XpsDocument(PATH_TO_YOUR_XPS_FILE_HERE, System.IO.FileAccess.Read); dlg.PrintDocument(xpsDoc.GetFixedDocumentSequence().DocumentPaginator, “Document title”); As you can see, reading a XPS file and then sending the contents to a printer is not very hard at all.
Having recently published my big Californian vacation video to YouTube I think it’s time to reminisce a bit about my adventures.As you already know from seeing the video and by photos in my photo album I went to Grand Canyon. Before traveling to the US, a colleague of mine mentioned the place where he visited Grand Canyon West and suggested I go there to.I looked up the place on Google Maps, found the GPS coordinates and plotted those into my GPS to get driving directions.My colleague warned me that the drive would seem a bit wrong because you would have to go onto some gravel roads, so when my GPS directed me onto a gravel road I didn’t think much of it.I did get a […] Read more