What should I do if a StreamReader in C has ReadToEnd and wants to read it again?

Updated on technology 2024-05-28
11 answers
  1. Anonymous users2024-02-11

    string totallines = ;

    Reset the file pointer to the file header.

    string firstline = ;

    Don't keep opening files, it's not cost-effective.

  2. Anonymous users2024-02-10

    The streamreader is equal to the time it passes itself, and these two variables indicate the same thing, of course, together with readtoend and readline

    Let's close and re-new.

    openfiledialog open = new openfiledialog();

    if ( ==

    streamreader sr = new streamreader(, "gb2312"));

    ;sr = new streamreader(, "gb2312"));

  3. Anonymous users2024-02-09

    Just turn it back on once.

  4. Anonymous users2024-02-08

    Then you'll have to get it again.

  5. Anonymous users2024-02-07

    streamreader sr = new streamreader("", ;

    Remember to encode, otherwise you will make a mistake when reading the Chinese characters.

    string text = ;

  6. Anonymous users2024-02-06

    string str= "");

    If you must use streamreader, you can write using (streamreader sr = new streamreader(""))}

  7. Anonymous users2024-02-05

    3 all, ; Invoke once before a new read to move the position of the read to the beginning of the stream. Premise The canseek of the base stream is true

  8. Anonymous users2024-02-04

    No matter which drive letter you put in, you can get the directory where the program runs, that is, you can get the drive letter where the program runs.

    You then splice the full path of the data.

  9. Anonymous users2024-02-03

    Two scenarios: Scenario 1, do not build an entity class, use dynamic:

    var jsonobject = ;

    string sign = jsonobject["sign"];

    The second solution is to create a new entity class of the corresponding structure, and find a reverse order judgment to deserialize the mountain sail method to make a hailstorm.

  10. Anonymous users2024-02-02

    Write reads out the text file.

    public void page_load(object src,eventargs e)

    streamwriter rw = ".")+"\\");

    test");

    test1");

    test2");;

    Open the text file.

    streamreader sr = ".")+"\\");

    stringbuilder output = new stringbuilder();

    string rl;

    while((rl=

  11. Anonymous users2024-02-01

    c does not have the readtoend() function to read the file and the data stream information to set a timeout.

    The normal implementation would be:

    The ability to read streaming data is a separate thread. The main thread monitors and determines whether it has timed out.

    If the subthread (read thread) exceeds the set or expected value, terminate the subthread.

Related questions
22 answers2024-05-28

2. Now, all we can do is wait, but soon, it won't take long, there is a premise here, that is, you must uninstall all the previous office-related software on your computer in the installation of office 2016, otherwise the installation will fail, if it still fails, you continue to install, it may be unsuccessful once, this is normal; >>>More

6 answers2024-05-28

Theme: Lotus flowers.

Mother said, "Tonight we have a harvest festival, and please ask your father to come and taste our lotus feast, okay?" "We all said yes. The mother made several kinds of food from lotus roots and lotus seeds, and ordered the festival to be celebrated in the back garden. >>>More

12 answers2024-05-28

This question involves:Roll calllaw". >>>More

9 answers2024-05-28

Solution: You can try to reset the earphones, under the system, you can select "Ignore this device" in the Bluetooth list of iphone11, and then press and hold the button on the charging case to reset the earphones; It may be that the headset hardware is faulty, it is recommended to contact after-sales for maintenance. Headset Tips: >>>More

11 answers2024-05-28

One of the two hukou cancellations only needs to bring two hukou books and the original ID card to the local police station to handle it, and when handling the cancellation of the hukou, the public security organ will issue a cancellation certificate, as long as you hold this certificate, you can change the driver's license, graduation certificate and other relevant personal information. >>>More