Category Archives: Programming

POP3 Terminal Commands

It’s a while that I am thinking about developing a portal at our student community at University to monitor the part time jobs for robotics & nano-electronics students that are posted online (Finn.no is popular place to do so in Norway). Finally this would come up on a screen where robotics and Nano students would be hanging out.

For this purpose I have either thought to connect directly to the database (waiting for the response from the website). If they do not let me to do so, I was thinking to have the announcements sent to me with email (a service that the website offers) and then process the emails and update the list. To this I came across connecting to email servers with POP3 and using POP3 terminal commands to read emails (a tutorial on this subject) and update my list to show on the screen.

USER userid
First command after connecting. E-mail userid (this may or may not not the full e-mail address). Example: USER testuser

PASS password
Password of the email account. PASS thisPasswordIsCool
Continue reading

Opening a folder at C#

To open a folder in C#, simply follow the following example :

[code lang="csharp"]
private void openFolder()
{
string myDocspath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);// if you are after special documents (e.g. my documents)
string myFolderpath = Application.StartupPath + "\\folderName\\"; // a folder right beside where you run the program
string windir = Environment.GetEnvironmentVariable("WINDIR");
System.Diagnostics.Process process = new System.Diagnostics.Process();
process .StartInfo.FileName = windir + @"\explorer.exe";
process .StartInfo.Arguments = myFolderpath;
process .Start();//OPEN the folder
}
[/code]


Source

How to Export Data to Excel without hassel

Saving query to excel format could go through Microsoft Office Interop services or some third party libraries. However there is a simpler way. CSV file formats are wuite simple and one could simply read queries and save them into a text file format with CSV as the extension (myfile.csv).

The tricks would be to have the data read from database by query and write each record as a line and semicolon to separate the column vales.This is actually language independent and one could implement it by C#, Java or any other language that could execute queries on a database.