【问题标题】:Reading a vcf file into an array of strings将 vcf 文件读入字符串数组
【发布时间】:2013-01-16 16:47:13
【问题描述】:

下面是我调用的一个方法,用于尝试将 vcf 文件逐行读取到字符串数组中。

    internal static void splitUpFile(String fileLocation)
    {
        string[] file = System.IO.File.ReadAllLines(fileLocation);


        System.Console.WriteLine("Contents of contacts.vcf =:");
        foreach (string line in file)
        {
            Console.WriteLine("\t" + line);
        }


        Console.WriteLine("Press any key to exit.");
        System.Console.Read();

    }

现在我想将数组拆分为另外三个 vcf 文件,这些文件是动态创建的,并与已读入的文件放在同一目录中?这可能吗?

【问题讨论】:

    标签: c# vcf-vcard


    【解决方案1】:

    要出现并保持打开控制台使用

    Console.ReadLine();
    

    在最后一行。

    使用以下步骤创建其他 vcf 文件:

    1. create a directory
    2. create a file with .vcf extension in that directory
    3. write data to and read data from that created file kept in the specified directory
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-09-12
      • 1970-01-01
      • 2011-08-18
      • 1970-01-01
      • 2011-08-01
      • 1970-01-01
      相关资源
      最近更新 更多