The WebClient class can be used to automate the login to a web application. If the web application requires the client to enable cookies which is often the case when the application uses session state, the application returns an error to the client indicating that cookies must be enabled. The WebClient class can be extended to support cookies by overriding the GetWebRequest method and implementing...
4/25/11
4/20/11
Start Multiple Projects with Visual Studio 2008 and 2010
By default, Visual Studio allows us to set a single Startup project on a solution. There are instances when we need to start multiple projects. A typical case is when we have a client and server console application, and we want to debug/start both at the same time. There is a feature on Visual Studio (2008 and 2010) that allows us to start multiple projects within a solution. To configure multiple...
3/16/11
WCF Service returns (400) Bad Request
If you implement a WCF service using the default values, and expect to be able to send to the server a large xml file, you may encounter an intermittent bad request error from the server. This error basically tells you that the server refuses to handle your request because it thinks that the request is not compliant with the HTTP protocol. The request however may be well formatted, but the message...
3/1/11
Improve Code Maintenance with Visual Studio Code Metrics Analysis
There are several factors that make a code very difficult to maintain. Some of the most common factors are never ending functions that may have hundreds lines of code and functions that have deep nesting if then else statements. Visual Studio comes with a feature call Code Metrics. This is available in the Analyze menu options or by selecting the project you want to analyze and selecting the Calculate...
2/27/11
HTML5 Web Database and Mobile Web Applications
The Web SQL Storage (based on SQLite) API in HTML 5 is ideal for Mobile Web applications that require a complex data storage support and that work mostly offline. The Web storage remains locally on the device, and it is persisted even after the application or browser is closed. The implementation of the data access is all done using JavaScript and the SQL script format is compliant with the SQLite...