Click here to Skip to main content
15,904,288 members
Home / Discussions / C#
   

C#

 
GeneralRe: VS2005, variables with values of form elements not updating when interacted with by user. Pin
Deresen18-Feb-09 5:21
Deresen18-Feb-09 5:21 
GeneralRe: VS2005, variables with values of form elements not updating when interacted with by user. Pin
Mihai Pruna18-Feb-09 6:07
Mihai Pruna18-Feb-09 6:07 
GeneralRe: VS2005, variables with values of form elements not updating when interacted with by user. Pin
Mihai Pruna18-Feb-09 8:20
Mihai Pruna18-Feb-09 8:20 
GeneralRe: VS2005, variables with values of form elements not updating when interacted with by user. Pin
Deresen18-Feb-09 12:20
Deresen18-Feb-09 12:20 
Questionhow to use load axwinsock in c# Pin
mghafar18-Feb-09 3:07
mghafar18-Feb-09 3:07 
AnswerRe: how to use load axwinsock in c# Pin
Rob Philpott18-Feb-09 4:07
Rob Philpott18-Feb-09 4:07 
AnswerRe: how to use load axwinsock in c# Pin
Dave Kreskowiak18-Feb-09 4:51
mveDave Kreskowiak18-Feb-09 4:51 
Questionhow can I put in process simultaneously all the txt files in folder? Pin
wwwxyz18-Feb-09 3:05
wwwxyz18-Feb-09 3:05 
how can I put in process simultaneously all the txt files in folder?Also I want to save a different folder the same name all the txt files.
please can you show on the code?
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;

class MainClass
{
    public static void Main(string[] args)
    {
        string inFile, filePath;
        string line;


        DirectoryInfo di = new DirectoryInfo(@"D:\a\");
        FileInfo[] files = di.GetFiles("*.txt");
        Console.WriteLine("Input file name to open!");
        Console.WriteLine("Sample: d:\\filename.txt");
        inFile = Convert.ToString(Console.ReadLine());
        StreamReader sr = File.OpenText(inFile);
        line = sr.ReadLine();
        foreach (FileInfo fi in files)
        {
            inFile = fi.FullName;
           
            Console.WriteLine();
            Console.WriteLine("Successful file open!...");
            Console.WriteLine();
            Console.WriteLine("Input file name to save!");
            Console.WriteLine("sample: d:\\filename.txt");
            filePath = Console.ReadLine();
            FileStream file = new FileStream(filePath, FileMode.Create);
            StreamWriter sw = new StreamWriter(file);
            List<string> lines = new List<string>();

            while ((line = sr.ReadLine()) != null)
            {
                lines.Add(line);
            }
            try
            {
                int numberOne = Int32.Parse(lines[0]);
                int numberTwo = Int32.Parse(lines[1]);
                int numberThree = Int32.Parse(lines[2]);
                int x = numberOne + numberTwo + numberThree;
                sw.WriteLine(x);
            }
            catch { }
            sw.Close();
            sr.Close();
        }

    }
}
        </string></string>

AnswerRe: how can I put in process simultaneously all the txt files in folder? Pin
EliottA18-Feb-09 3:08
EliottA18-Feb-09 3:08 
GeneralRe: how can I put in process simultaneously all the txt files in folder? Pin
wwwxyz18-Feb-09 3:13
wwwxyz18-Feb-09 3:13 
GeneralRe: how can I put in process simultaneously all the txt files in folder? Pin
EliottA18-Feb-09 3:22
EliottA18-Feb-09 3:22 
GeneralRe: how can I put in process simultaneously all the txt files in folder? Pin
wwwxyz18-Feb-09 3:38
wwwxyz18-Feb-09 3:38 
AnswerRe: how can I put in process simultaneously all the txt files in folder? Pin
Nagy Vilmos18-Feb-09 3:41
professionalNagy Vilmos18-Feb-09 3:41 
AnswerRe: how can I put in process simultaneously all the txt files in folder? Pin
wwwxyz18-Feb-09 12:00
wwwxyz18-Feb-09 12:00 
QuestionClosing a exe file Pin
mrithula818-Feb-09 3:01
mrithula818-Feb-09 3:01 
AnswerRe: Closing a exe file [modified] Pin
Calin Tatar18-Feb-09 3:08
Calin Tatar18-Feb-09 3:08 
AnswerRe: Closing a exe file Pin
Nuri Ismail18-Feb-09 3:08
Nuri Ismail18-Feb-09 3:08 
GeneralRe: Closing a exe file Pin
mrithula818-Feb-09 18:11
mrithula818-Feb-09 18:11 
GeneralRe: Closing a exe file [modified] Pin
Nuri Ismail18-Feb-09 21:49
Nuri Ismail18-Feb-09 21:49 
GeneralRe: Closing a exe file Pin
mrithula818-Feb-09 23:11
mrithula818-Feb-09 23:11 
GeneralRe: Closing a exe file Pin
Nuri Ismail18-Feb-09 23:14
Nuri Ismail18-Feb-09 23:14 
Questiondraw a line similar to the one present in ms word Pin
sabeel alwosol18-Feb-09 2:59
sabeel alwosol18-Feb-09 2:59 
AnswerRe: draw a line similar to the one present in ms word Pin
Thomas Stockwell18-Feb-09 4:22
professionalThomas Stockwell18-Feb-09 4:22 
QuestionCompare file length and lines of data in 2 files inside a zip file Pin
Member 322226418-Feb-09 2:56
Member 322226418-Feb-09 2:56 
AnswerRe: Compare file length and lines of data in 2 files inside a zip file Pin
Deresen18-Feb-09 4:03
Deresen18-Feb-09 4:03 

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.