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.
我有一个表示路径的字符串 var (path):
printfn "Please enter a path" let path = System.Console.ReadLine()
有没有办法知道这个路径是用于目录还是常规文件?
使用Directory.Exists(path)和File.Exists(path)。
Directory.Exists(path)
File.Exists(path)