Click here to Skip to main content
15,906,766 members
Home / Discussions / C#
   

C#

 
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 
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 
problem solved.
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;

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

        const string inDir = "D:\\data\\A\\";
        const string outDir = "D:\\data\\B\\";
        DirectoryInfo di = new DirectoryInfo(inDir);
        FileInfo[] files = di.GetFiles("*.txt");
        foreach (FileInfo fi in files)
        {
            inFile = fi.FullName;
            StreamReader sr = File.OpenText(inFile);
            List<string> lines = new List<string>();

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

            sr.Close();
            string destFile = Path.Combine(outDir, fi.Name);
            File.WriteAllText(destFile, Convert.ToString(x));
        }

    }
}
</string></string>

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 
QuestionCross domain AD search Pin
NanaAM18-Feb-09 2:03
NanaAM18-Feb-09 2:03 
QuestionUnwanted Dash in HTTP request string Pin
cfoxtrot18-Feb-09 1:44
cfoxtrot18-Feb-09 1:44 
QuestionUsing PowerPoint Application in .net Pin
nameen18-Feb-09 1:06
nameen18-Feb-09 1:06 
Questiondrawing lines at runtime Pin
maisa.z18-Feb-09 0:30
maisa.z18-Feb-09 0:30 
AnswerRe: drawing lines at runtime Pin
J4amieC18-Feb-09 0:41
J4amieC18-Feb-09 0:41 
AnswerRe: drawing lines at runtime Pin
dan!sh 18-Feb-09 2:15
professional dan!sh 18-Feb-09 2:15 

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.