Category: c#

Simple Data Access Class for Access database

Simple Data Access Class for Access database

After little time i have to wrote a simple data access layer for MS Access database, For Connection string I wrote a simple Util Class as using System; using System.Collections.Generic; using System.Linq; using System.Web;...

how to write a tab delimited text file using C#.net

how to write a tab delimited text file using C#.net

Use following Code StreamReader sr = new StreamReader(@”d:simpleTabDelimeterFile.txt”); StreamWriter outputFile = new StreamWriter(@”d:out.txt”); string strline = “”; string[] _values = null; while (!sr.EndOfStream) { strline = sr.ReadLine(); _values = strline.Split(‘t’); if( _values.Length == 3...

How to resize image in .net

How to resize image in .net

use follwing Code change image path at load event method for downloading Code Imports System Imports System.Drawing Imports System.Drawing.Imaging Imports System.Drawing.Drawing2D Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)...

How to get uploaded image dimensions in asp.net

How to get uploaded image dimensions in asp.net

I used following code to get uploaded image dimensions . Where flLogoUplaoded is name of asp .net file uploaded control at my application string UploadedImageType = flLogoUpload.PostedFile.ContentType.ToString().ToLower(); string UploadedImageFileName = flLogoUpload.PostedFile.FileName; //Create an image...

Saving and Restoring Form Location

Saving and Restoring Form Location

A common requirement for a form is to remember its last location. Usually, this information is stored in the registry. The code that follows shows a helper class that automatically stores information about a...