zoukankan      html  css  js  c++  java
  • 从一个文本文件中读取一组数据放在一个文本框里,然后打印

    
    using System;
    using System.Collections.Generic;
    using System.Text;

    namespace ConsoleApplication1
    {
    class Program
    {
    static void Main(string[] args)
    {

    // The files used here were created in the code example
    // in How to: Write to a Text File. You can of course substitute
    // other files of your own.

    // Example #1
    // Read the file as one string.
    string text = System.IO.File.ReadAllText(@"D:\Test1.txt");

    // Display the file contents to the console.
    System.Console.WriteLine(@"D:\Test1.txt = {0}", text);

    // Example #2
    // Read the file lines into a string array.
    string[] lines = System.IO.File.ReadAllLines(@"D:\Test2.txt");

    System.Console.WriteLine(
    @"D:\Test2.txt =:");
    foreach (string line in lines)
    {
    Console.WriteLine(
    "\t" + line);
    }

    // Keep the console window open in debug mode.
    Console.WriteLine("Press any key to exit.");
    System.Console.ReadKey(); }


    }
    }
  • 相关阅读:
    springboot-配置文件
    system--属性
    url--web路径
    jquery--遍历
    javascript---知识点2
    iframe
    linux--磁盘挂载
    jquery--插件
    javascript窗口宽高
    vue--知识点
  • 原文地址:https://www.cnblogs.com/beeone/p/1998290.html
Copyright © 2011-2022 走看看