Click here to Skip to main content
15,887,596 members
Articles / Programming Languages / C#
Article

Console User Information Creater

Rate me:
Please Sign up or sign in to vote.
1.50/5 (7 votes)
7 Dec 2007CPOL 19.4K   143   14   1
Creates User Information from Input into a Text File - C#
Screenshot -

Introduction

This Code Will take all of the entered user information and compile it to a text file that was created by the program which wil be placed in a folder made aswell.

Using the code

The namespace is 'ProfileAdder.cs'

It compiles and runs fine

using System;

using System.Collections.Generic;

using System.Text;

using System.IO;

namespace Menu2

{

class ProfileAdder

{

static void Main(string[] args)

{

Console.Title.Equals("DATABASE");

Console.WriteLine("User Profile");

Console.WriteLine();

Console.WriteLine("*******************************************");

Console.WriteLine();

Console.WriteLine("Type your Name");

Console.WriteLine();

string text = Console.ReadLine();

string a = (text);

Console.WriteLine();

Console.WriteLine("Your Name is " + (text));

Console.WriteLine();

Console.WriteLine("*******************************************");

Console.WriteLine();

Console.WriteLine("Type Your Age ");

Console.WriteLine();

string text1 = Console.ReadLine();

string b = (text1);

Console.WriteLine();

Console.WriteLine("You are " + (text1));

Console.WriteLine();

Console.WriteLine("*******************************************");

Console.WriteLine();

Console.WriteLine("Type Your Gender");

Console.WriteLine();

string text2 = Console.ReadLine();

string c = (text2);

Console.WriteLine();

Console.WriteLine("You are " + (c));

Console.WriteLine();

Console.WriteLine("*******************************************");

Console.WriteLine();

Console.WriteLine("COMPILING TO A DATABASE");

Console.WriteLine();

Console.WriteLine("*******************************************");

Console.WriteLine();

Console.WriteLine("*******************************************");

Console.WriteLine();

Console.WriteLine("DONE");

Console.WriteLine();

Console.WriteLine("*******************************************");

Console.WriteLine();

Console.WriteLine("NAME : " + (a));

Console.WriteLine("AGE : " + (b));

Console.WriteLine("GENDER : " + (c));

Console.WriteLine();

Console.WriteLine("*******************************************");

Console.WriteLine();

Console.WriteLine("To create the Save Directory Press Enter");

Console.ReadLine();

{

Console.WriteLine("CREATING NOW....");

Console.WriteLine(".");

Console.WriteLine();

System.Threading.Thread.Sleep(1000);

Console.WriteLine(".");

Console.WriteLine();

System.Threading.Thread.Sleep(1000);

Console.WriteLine(".");

Console.WriteLine();

System.Threading.Thread.Sleep(1000);

Console.WriteLine(".");

Console.WriteLine();

DirectoryInfo dirInfo = Directory.CreateDirectory("C:/Database/Input/Users");

Console.WriteLine("DONE");

}

Console.WriteLine("*******************************************");

{

Console.WriteLine("Press Enter to Compile the Data to a Text File");

Console.ReadLine();

Console.WriteLine(".");

Console.WriteLine();

System.Threading.Thread.Sleep(1000);

Console.WriteLine(".");

Console.WriteLine();

System.Threading.Thread.Sleep(1000);

Console.WriteLine(".");

Console.WriteLine();

System.Threading.Thread.Sleep(1000);

Console.WriteLine(".");

Console.WriteLine();

}

{

Console.WriteLine("*******************************************");

}

{

System.Threading.Thread.Sleep(1000);

Console.WriteLine();

Console.WriteLine(".");

Console.WriteLine();

}

{

Console.WriteLine("USER CREATED");

}

{

System.Threading.Thread.Sleep(1000);

Console.WriteLine();

Console.WriteLine(".");

Console.WriteLine();

}

{

Console.WriteLine("*******************************************");

}

{

StreamWriter sw = new StreamWriter("C:/Database/Input/Users/User.txt");

string line = "Your Data Entered";

string line1 = "";

string line2 = "";

string line3 = "NAME : " + (a);

string line4 = "AGE : " + (b);

string line5 = "GENDER : " + (c);

string line6 = "";

string line7 = "Thank You";

sw.WriteLine(line);

sw.WriteLine(line1);

sw.WriteLine(line2);

sw.WriteLine(line3);

sw.WriteLine(line4);

sw.WriteLine(line5);

sw.WriteLine(line6);

sw.WriteLine(line7);

sw.Close();

}

{

Console.WriteLine("Press Enter to Quit");

Console.ReadLine();

}

}

}

}

This was written in C#

Points of Interest

I had fun writing this in the 4 hours it took me!!!

History

I am new at this

Would love feedback and any questions at:

ilovefood11@hotmail.co.uk

Thank You

Oliver Chrisite

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionOld way Pin
Aleksandar Nedeljkovic29-Mar-20 9:39
Aleksandar Nedeljkovic29-Mar-20 9:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.