Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Console User Information Creater

0.00/5 (No votes)
7 Dec 2007 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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here