Event Viewer Logging via .NET EventLog

April 11, 2013 in .NET, C#

Event Viewer

Today, I will provide you an easy way of putting a log information for your application under Event Viewer. Of course, professionally I would advise you to make your own or use better log frameworks like log4net or ELMAH for your .NET applications.  But what I show you here is too handy in start-up and development environments. So if you are trying something or proving the concept first at your application, you can use the below very simple code block to take your applications log.

Logged records are hold by windows default Event Viewer. If you want to have an appropriate source location at Event Viewer, than you need to open Event Viewer under Administative Tools and manually create it.

Below class implementation can store your exceptions and informations using EventLog object of .NET Framework

 

 

 

Downloading File via FTPWebRequest

April 5, 2013 in .NET, C#

imageftp

Previous article was about getting the list of files at an FTP directory. At this one, instead of getting the list of files, we will try to download the files using again FTPWebRequest class. Actually there is no significant change on the code. Only the method property is different as you see below;

Again I will give the whole method for more clear understanding.

Now we have both a method for getting the filelist of a directory and also a method for downloading the file. So I guess, you already imagine what we can do with these two :)

Yes, download a whole directory…
Let’s see the small method using these two pretty ones.

Again please provide feedback via comment. Every comment will be taken seriously if they are not like spam.

Getting File List via FTPWebRequest

April 5, 2013 in .NET, C#

imageftp

Everytime and mostly in integration projects, we would like to have the file list and check if our file is realy there or directly download the content of the folder. In this article, I would like to share the small code segment implemented by C# and using FTPWebRequest class of .NET Framework.

After this article, I will also provide the way to download the files. As you will directly notice that it is totally independent class to do its own work only. Nothing more, nothing less.

Without going too much details, I will provide the code as below. Please do not hesitate to make any suggestions or comments related to the code.

Upon suggestion of my friend, I will provide a small code that consumes the above method but runs asynchroniously. But since the async and await is supported at .NET 4.5 please proceed with caution.

 

Email Sender via .NET

March 11, 2013 in C#

email senderJust another reusable code for sending an e-mail. I hope no introduction required. If so don’t hesitate to comment. An email sender that is using SMTPClient of .NET

Week Start and Week End Calculation

March 11, 2013 in C#

Week_Number-1p1fJust to be a reusable code. Inserting it as below. I guess pretty clear enough, who knows C#.  C# calendar week number is the input and the outputs are the start and end date of that week.

Basically calculates the start and end date of the week for a given weeknumber + year;

Coming back to your previous Company

March 11, 2013 in Career

Company
After taking over some management resposibilities, I am encountring different things that I had never think of. Teoretically I am not a fun of any company in principal and people can choose to start as an employee of a company or resign of his job. There is nothing wrong with that. But, since you have some reasons to search for a job and thinking on resigning than this reasons should have a solid base. Otherwise, both ethically and professionally this doesn’t make sense, cause starting a new job and be known and approved by your new company takes time. On the other hand, nowadays I hear/experience that people are going back to their previous employers.

Question 1 : Didn’t you experience bad past with that company and you resign?
Question 2 : Aren’t your reasons solid enough so that you are going back?

Personally a career with your previous company is harder than a not known one. You know the things that are not going well, you know the people and in most cases these didn’t change. So is it the money they offered or you decided that you made a wrong decision?

Please provide me your comments, cause as a logical guy, I cannot find a satifying answer.

 

 

Moving Blog To WordPress + English

March 8, 2013 in Blog

wordpressI have moved my blog to a wordpress base. Also decided to share my experience in English. When I started blogging WordPress was not that powerful and customizable enough, but now I see that it is hugely improved. Not only a blog engine but a powerful CMS.

If you want to access my old blog please click here.. Keep in mind that it is Turkish.

Mainly I started writing Turkish but after a while most of the traffic is also coming outside of Turkey. So as a result, I wanted to switch to a comman language.

The topic is same as before.. My development problem solutions that I or together as a team has experienced.

I will be sharing them for you and also for me. This topic would be meaningless cause I am going to remove the link when I completed to convert the whole articles into English. Also if you want me to continue more efficient to write valuable content, please click the ads once in a while and buy me a beer :)