■■■

2016年4月8日金曜日

フォルダの存在確認を行う方法

フォルダの存在確認を行う方法
VB.NET
        ' フォルダの存在確認を行う方法
        If System.IO.Directory.Exists("C:\dic\") Then
            Console.WriteLine("存在する")
        Else
            Console.WriteLine("存在しない")

        End If

C#
            // フォルダの存在確認を行う方法
            if (System.IO.Directory.Exists(@"C:\dic\"))
            {
                Console.WriteLine("存在する");
            }
            else
            {
                Console.WriteLine("存在しない");

            }

■■■