「効率的に結果を出すにはこの機能も欲しいな」「こんなプラグインがあったらめちゃくちゃ便利だな」という思いの元で開発していますので有料となりますが、他社製プラグインにはない強力な機能を搭載したプラグインとなっています。
C:\temp\abcde.csusing System;
using System.IO;
class Example
{
static void Main()
{
string contents = GetText(@"C:\temp", "example.txt");
Console.WriteLine("Contents of the file:\n" + contents);
}
private static string GetText(string path, string filename)
{
var sr = File.OpenText(AppendPathSeparator(path) + filename);
var text = sr.ReadToEnd();
return text;
// Declare a local function.
string AppendPathSeparator(string filepath)
{
if (!filepath.EndsWith("\"))
{
filepath += "\";
}
return filepath;
}
}
}