File - ReadLine() - InfoPath Dev
in

InfoPath Dev

File - ReadLine()

Last post 02-12-2007 01:43 AM by diaboloche. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-01-2007 07:22 AM

    File - ReadLine()

    Hi,

    I want to read a file until the end of that-çi... I do not find the property which determines the end

    Sorry for my bad English


    var fso, f, ts, s;
    var ForReading = 1, ForWriting = 2, ForAppending = 8;
    var TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0;

    fso = new ActiveXObject("Scripting.FileSystemObject");
    //fso.CreateTextFile( "C:/test1.txt" ); // Crée un fichier
    f = fso.GetFile("C://test1.txt");
    ts = f.OpenAsTextStream(ForReading, TristateUseDefault);
    //while(ForWriting > 1)
    //{
    while(ts.????????????)
    {
    s=ts.ReadLine();
    XDocument.UI.Alert(s);
    }

    ts.Close( );
  • 02-01-2007 07:47 PM In reply to

    Hi Diaboloche,
    I'm sorry but I don't quite uderstand what you are looking for. This does seem like more of a straightforward coding question and I don't see where this has much to do with InfoPath. We are helping people with InfoPath not coding.
    Patrick Halstead
    Project Manager at Qdabra
  • 02-06-2007 10:00 AM In reply to

    Console.WriteLine("Reading the contents from the file");
    StreamReader s = File.OpenText("Mytext.txt");
    string read = null;
    while ((read = s.ReadLine()) != null)
    {
    Console.WriteLine(read);
    }
    s.Close();


    http://www.codeguru.com/Csharp/Csharp/cs_syntax/anandctutorials/article.php/c5861/
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 02-12-2007 01:43 AM In reply to

    I used this

    while (!ts.AtEndOfStream)
    {
    s=ts.ReadLine();
    Decouper_Mesure(s);
    }


    Thanks !
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.