Click here to Skip to main content
15,888,610 members
Home / Discussions / C#
   

C#

 
Questionselecting multiple controls with ctrl key pressed Pin
teknolog12321-Mar-10 3:19
teknolog12321-Mar-10 3:19 
AnswerRe: selecting multiple controls with ctrl key pressed Pin
Not Active21-Mar-10 4:02
mentorNot Active21-Mar-10 4:02 
AnswerRe: selecting multiple controls with ctrl key pressed Pin
Kristian Sixhøj21-Mar-10 4:18
Kristian Sixhøj21-Mar-10 4:18 
AnswerRe: selecting multiple controls with ctrl key pressed Pin
AspDotNetDev21-Mar-10 11:31
protectorAspDotNetDev21-Mar-10 11:31 
GeneralRe: selecting multiple controls with ctrl key pressed Pin
teknolog12322-Mar-10 2:55
teknolog12322-Mar-10 2:55 
GeneralRe: selecting multiple controls with ctrl key pressed Pin
AspDotNetDev22-Mar-10 6:34
protectorAspDotNetDev22-Mar-10 6:34 
AnswerRe: selecting multiple controls with ctrl key pressed Pin
yu-jian21-Mar-10 19:03
yu-jian21-Mar-10 19:03 
QuestionText file to multidimensional array help needed! Pin
venomation21-Mar-10 2:56
venomation21-Mar-10 2:56 
I have a notepad text file that looks like this:

xxxxixxxxxcxxxxxxxxixxxxt
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx

25 across, 19 down...

And some code to read in the text file:

FileStream fs = File.OpenRead("maptest.txt");
     StreamReader reader = new StreamReader(fs);
     string x = string.Empty;
     while (!reader.EndOfStream)
     {
         int y = reader.Read();
         char z = (char) y;
         if (z == 'x' || z == 'c' || z == 'i' || z == 't') x += z.ToString();
     }

     char[,] map = new char[25, 19];
     int index = 0;
     for (int row = 0; row < 25; row++)
     {

         for (int col = 0; col < 19; col++)
         {
             map[row, col] = x[index];
             index++;
         }

     }

My array "char[,] map = new char[25, 19]" is meant to store x and y cords of each character ie to find the first instance of the character "i" I can get its by referencing "map[4,0]".

My text reader is wrong and I need some help to read in the values into the array Laugh | :laugh:
AnswerRe: Text file to multidimensional array help needed! Pin
Not Active21-Mar-10 3:59
mentorNot Active21-Mar-10 3:59 
GeneralRe: Text file to multidimensional array help needed! Pin
harold aptroot21-Mar-10 4:42
harold aptroot21-Mar-10 4:42 
GeneralRe: Text file to multidimensional array help needed! Pin
Not Active21-Mar-10 4:45
mentorNot Active21-Mar-10 4:45 
AnswerRe: Text file to multidimensional array help needed! Pin
Rod Kemp21-Mar-10 4:03
Rod Kemp21-Mar-10 4:03 
GeneralRe: Text file to multidimensional array help needed! Pin
venomation21-Mar-10 4:31
venomation21-Mar-10 4:31 
GeneralRe: Text file to multidimensional array help needed! Pin
harold aptroot21-Mar-10 4:51
harold aptroot21-Mar-10 4:51 
QuestionCollectionBase and Updating an Item Pin
Ryan Minor21-Mar-10 1:57
Ryan Minor21-Mar-10 1:57 
AnswerRe: CollectionBase and Updating an Item Pin
Not Active21-Mar-10 3:53
mentorNot Active21-Mar-10 3:53 
AnswerRe: CollectionBase and Updating an Item [modified] Pin
DaveyM6921-Mar-10 3:57
professionalDaveyM6921-Mar-10 3:57 
Questionc# & oracle Pin
amer shammout21-Mar-10 0:18
amer shammout21-Mar-10 0:18 
AnswerRe: c# & oracle Pin
Not Active21-Mar-10 1:50
mentorNot Active21-Mar-10 1:50 
QuestionHow to Dynamic add html in GridView by c# code???? Pin
mimimimilaw20-Mar-10 20:30
mimimimilaw20-Mar-10 20:30 
AnswerRe: How to Dynamic add html in GridView by c# code???? Pin
Rod Kemp20-Mar-10 21:10
Rod Kemp20-Mar-10 21:10 
QuestionStop files being deleted ? Pin
BuggingMe20-Mar-10 12:42
BuggingMe20-Mar-10 12:42 
AnswerRe: Stop files being deleted ? Pin
Not Active20-Mar-10 12:56
mentorNot Active20-Mar-10 12:56 
GeneralRe: Stop files being deleted ? Pin
BuggingMe20-Mar-10 13:09
BuggingMe20-Mar-10 13:09 
GeneralRe: Stop files being deleted ? Pin
Not Active20-Mar-10 13:36
mentorNot Active20-Mar-10 13:36 

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.