Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ファイルが物理的に最後に開いたときに問題に直面しています。ファイルが開いているかどうかに関する情報が表示されます (ファイルは .xml 、 .txt など)。
では、このファイルに関する情報を取得する方法。
前向きな返事を待っています。
ありがとう、
サンワル。
ファイルが ASP.NET Web サイトのディレクトリ構造内にある場合は、 を使用Server.MapPathしてディスク上のファイルの場所を取得できます。これが実際の例です:
Server.MapPath
var file = new FileInfo(Server.MapPath("~/SomeFolder/SomeFile.txt"));
ファイルがWeb サイト内にない場合は、ファイルにアクセスし、DataContract
DataContract