Free Information Technology Magazines and eBooks

Saturday, March 28, 2009

C#: Download File from website using Web Client Class

Starting next week we are to start the integration testing of our automated gate system project. We have two (2) different business servers that needs to communicate. These two busines systems have different platform, one is using Java+MySQL while the other one is on .NET+Legacy Database. Aside from plain messages, most of the time, B2B applications today also exchange files. Ofcourse we can do it using File Transfer Protocol (FTP) applications but since message exchanges often done through web service then we can do the same thing with file transfer. We can achieve this by using Webclient of System.Net namespace. Below is a sample code for starters.


using System;
using System.Net;
using Myapp.Properties;

namespace MyApp
{
public class Test
{
static void Main(string[] args)
{
string website ="http://www.fryan0911.com/webclientsample.zip";
string downloadfolder = Settings.Default.DownloadFolder;

try
{
WebClient wc = new WebClient();
wc.DownloadFile(website, downloadfolder);
Console.WriteLine("Web file has been downloaded to " + downloadfolder);
}
catch (WebException e)
{
Console.WriteLine(e.Message);
}
Console.ReadKey();
}
}
}



Friday, March 27, 2009

How to disable the User Account Control (UAC) on Windows Vista computer?

Security on Windows vista machines are truly exceptional compare to earlier versions. One of Vista's security feature is the User Account Control which prompt users to enter admin login details (if already logged as admin, a confirmation prompt is displayed) before continuing to run applications that may change windows settings such as new software installation or accessing the ODBC manager. This feature really helps but sometimes its annoying when you have to do several system changes like hardware installation and applying patches. To temporarily disable UAC, you can do it in two (2) ways:

Using Control Panel
Step 1: Open windows controlpanel. Start > Control Panel



Step 2: Click on the User Accounts
Step 3: On the next screen, click the user accounts again as shown below



Step 4: Then finally click "Turn User Account Control on or off".




Using MSCONFIG
You can achieve the same goal using MSCONFIG.
Step 1: Run MSCONFIG from run/search box.
Step 2: On MSCONFIG, go to Tools tab.
Step 3: Choose Tool Name "Disable UAC" then click Launch button as shown below.




To enable it again, follow the same steps. Please be aware that by doing this your making your machine vulnerable to security threats.

Tuesday, March 24, 2009

C# Open Source: Proxy Log Analyzer

Last month, my ex-office mate asked me a favor to create a software that can read their proprietary web proxy logs. He want the software to be able to parse a certain format of web proxy log and display it in spreadsheet format. This software should also be able to maintain identified IPs and the user who owns it. We named the owner as the responsible party, the application can filter views by [responsible] column so the IT manager can easily identify websites that are commonly visited by this user. Each column on the spreadsheet can be sorted so the manager can easily view it by website, IP, users and datetime.

The software was successfully installed and implemented on their company's intranet so I decided to share it to others. Proxy Log Analyzer was developed using Visual Studio C# Express 2008 so you must have at least .NET 3.5 Framework to run it. Below are some screen caps

Log Reader/Parser Module



Spread sheet module


You can download the full source code here
Note: You need to register once to morefreesoftware.com before you can download any software

Monday, March 23, 2009

GMAIL undo send

This morning upon logging in to my gmail account, I got curious on clicking the "New in Labs" link on the upper menu. Another great feature from google... the "Undo Send". It gives user a grace period of few seconds to cancel sending a message. Thats what I love from google people, they know what ordinary users want to have or wish to have. Imagine if this function is available on cellphones particularly on sending SMS and MMS. Or what if there is a technology that can retrieve back any unread sent messages... Hmmm... That's cooler.

Here a some screen shots of my testing.

Upon sending, you have few second to undo it.




Then after clicking undo, it will open the message for editing



Try it yourself!.