以下は私のインストラクターから提供されたもので、友人のWin 7では問題なく動作します。仕事用のラップトップと個人用のデスクトップを試しましたが、次のエラーが表示され続けます
わかりません...ディレクトリへのアクセス許可をキックのために全員に変更するところまで行きました...それは彼のコピーペーストでは機能しますが、私のものでは機能しません。
「パス 'c:\Users\Wookie\My Documents\' の一部が見つかりませんでした。」
using System;
using System.IO;
class Program
{
static void Main()
{
// This line of code gets the path to the My Documents Folder
string environment = System.Environment.GetFolderPath
(System.Environment.SpecialFolder.Personal) + "\\";
Console.WriteLine("Enter a file name in My Documents: ");
string input = Console.ReadLine();
// concatenate the path to the file name
string path = environment + input;
// now we can use the full path to get the document
StreamReader myFile = new StreamReader(path);
int n = int.Parse(myFile.ReadLine());
Console.WriteLine("read {0}", n);
Console.ReadLine();
}//End Main()
}//End class Program