Menu

Sunday, November 21, 2010

How To get User ID & Password text file?

Step1. Import "IO" package.
using System.IO;

Step2.Declarer Four String Variables.
string username = "";
string password = "";

string str1 = "";
string str2 = "";


Step3.Write Two StreamReader's Objects their Constructors & Path of the .txt Files
StreamReader sr1 = new StreamReader(@"c:\Foldername\\ID.txt");
StreamReader sr2 = new StreamReader(@"c:\Foldername\\Password.txt");

Step4.Write While Loop to Read ID & Password Files's Data.
while ((str1 = sr1.ReadLine()) != null)
{
username=str1;
}

while ((str2 = sr2.ReadLine()) != null)
{
password=str2;
}


Step5.Write "IF" Condition To check is ID & Password are correct.
if(txtUserID.Text==username && txtPasswoed.Text==password)
{
MessageBox.Show("Welcome");
}
else
{
MessageBox.Show("Invalid UserID or Password");
}

Monday, September 27, 2010

ASP.NET Special Folders

ASP.NET defines several Special folders.

When a new Web site is created the App_Data folder is created by default.
It can contain a SQL Server 2005 Express Edition database, another database, or an XML data file that will be used in the Web site.

These folders are protected by ASP.NET
For example, if a user attempts to browse to any of there folders
(except App_Themes)
User will receive an HTTP 403 Forbidden error.



Saturday, September 25, 2010

Insert Update Delete with XML

Create 2 Text Fields | TxtName, TxtEmail
3 Buttons | BtnAdd, BtnDelete, BtnEdit
1 Gridview | Gridview1
1 Label |  Label1

Right Click on Gridview select properties
In properties find columns
select CommandFields Add Select Field

Goto Solution Explorer 
Right click on App_Data folder and select add new item
Then select xml and name it users.xml

Friday, September 24, 2010

Text To Speech

The text entered in the textbox should come as a voice.







In Design View


Put one textbox or button

Thursday, September 23, 2010

Play Sound On Button Click C#

In Visual Studio
Go to solution explorer create new folder and name it sounds
Right Click on sounds folder then select Add Existing Item
Add your .wav files in sounds folder

Wednesday, September 22, 2010

User Login With XML C#


The following post demonstrates how to use a Login control to provide a user interface to log on to a Web site with XML.