Category Archives: Programming

How to watch your log through your application in Log4Net

Log4Net is an excellent logging system that allows you to clearly see what your application is doing and when, making it very easy to debug your app during development but especially during production. I have previously demonstrated how to use Log4Net in C# which enables you to log output to your console for the former and to a file for the latter, but recently I had a requirement to also log to screen during production. This is how I achieved it:

Continue reading How to watch your log through your application in Log4Net

How to access WebAPI from a .Net 3.5 client in C#

So, like me, you may have come across some incompatibility within your WebAPI client that means you can’t use .Net 4/4.5 (which is required to use HttpClient and HttpResponseMessage etc.) – or you’re writing a web service to fill in due to this incompatibility. This solution should allow you to access your API (using POST) from .Net 3.5 (and above, maybe even below).

Continue reading How to access WebAPI from a .Net 3.5 client in C#

Installing your C# project in Visual Studio 2012 (or earlier)

So you may or may not be aware that Visual Studio 2012 no longer has a built in project that will install your application for you – I can understand why this is, as it allows third parties to develop these and lets them focus on improving the programming experience, but I can also understand that this change has frustrated and confused developers (like myself). So I thought I’d share a guide as to how you can create an installer for your Visual Studio 2012 project (NOTE this also works in older versions).

Continue reading Installing your C# project in Visual Studio 2012 (or earlier)

Loading JSON web service in to PHP

As I’ve recently had to implement the JSON implementation of the Twitter Search API v1.0 as a hotfix into ThinkTwit, I thought it might be useful to share how I did this…

So if you’re here it’s probably because you need to read JSON in PHP or you have to implement an API, maybe the Twitter API. First of all you need to construct your URL, if you are using the Twitter Search API it may look like this:
Continue reading Loading JSON web service in to PHP

Clearing Temporary Internet Files in C#

I recently ran in to an issue (I actually ran in to multiple issues*) when using the WebBrowser control in Visual Studio 2010, C# .Net Framework 4.0, whereby the embedded Internet Explorer browser was able to login to the website we were using for a project was not successfully tidying up after itself when closed.

Continue reading Clearing Temporary Internet Files in C#

AJAX-ifying WordPress Widgets

I recently found the need to give AJAX abilities to a WordPress widget. Notably, I had a request from Kjell Martin Bovre of Scribo.no to allow ThinkTwit to update when used with a caching engine, for instance WP Super Cache. Caching engines work by converting the pages of a site in to HTML and, rather than loading the website code using calls to its database, calling these pages directly when a user makes a request.

Continue reading AJAX-ifying WordPress Widgets