Weblog Of Nirandas

Developer From INDIA

Quick FTP file upload in .NET

clock June 27, 2009 03:15 by author Nirandas

Uploading files using FTP is quick and easy in .NET framework. Below is a simplest possible method to upload a local file to a FTP server. Example is in VB.NET, converting it to C# should not be a problem.

Dim w As New System.Net.WebClient
w.Credentials = New System.Net.NetworkCredential(var_user, var_pwd)
w.UploadFile(var_url, var_localfile)

Here var_user and var_pwd refers to FTP username and password. The var_localfile variable holds the full path to the file to upload. The var_url variable should contain the URL where to upload the file, including the filename on the server. For example, “ftp://www.example.com/uploads/test.txt”.

The System.Net.WebClient class contains many other easy to use methods for uploading/downloading data.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


If blocks and readable code

clock June 17, 2009 14:30 by author Nirandas

Writing readable code is as important as writing high performance working code. One of the things which can easily affect the readability of the code we write is improper structuring of if/else blocks. Consider the following example method
More…

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Serializing and Deserializing objects using BinaryFormatter

clock June 4, 2009 11:26 by author Nirandas

Often, the software you create must have the ability to persist data for later retrieval. When the data you save is only for your application or you are looking for an efficient way of storing your objects, BinaryFormatter is the answer. BinaryFormatter class is in the System.Runtime.Serialization.Formatters.Binary namespace. The BinaryFormatter class allows you to quickly convert objects into binary form for saving to a file or sending across network. The primary requirement for enabling serialization is marking the type as Serializable. In C#

More…

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


New Feature Rich Card Games for Visually Impaired

clock June 4, 2009 04:15 by author Nirandas

Couple of days ago, BlindAdrenaline) released new set of card games specially designed for visually impaired persons. The following 2 games are currentlly supported. However, there are plans to keep on adding new games.

  1. Hold em
  2. Hearts

More…

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Some key C# operator and their VB.NET counterpart

clock May 20, 2009 09:41 by author Nirandas


In this post I try to describe some commonly used C# operator and their VB equivalent. This is intended as quick reference for C# or VB programmers who know one language but are in  the process of learning the other. So, let's start.



More…

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Using Email instead of Username for logging in

clock May 17, 2009 05:26 by author Nirandas

ASP.NET provides various ready-made controls for making our life easier. One of them is Login control. ASP.NET Login control can be used for displaying a standard UI for user login.. The control displays two textboxs for entering username/password and a checkbox for indicating whether to remember the user on this computer. The Login control does not by default allow to set whether to use username and password as the log in or email and password should be used. In this post I'll show how we can easily change this behavior and allow our members to use their email address while logging in.

More...

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Who Am I?

I am Nirandas - a developer from INDIA

RecentComments

Comment RSS

Sign in