URIが有効な仮想パスであるかどうかを判断する機能はありますか?文字列が与えられ、文字列が有効な仮想パスでない場合、例外をスローせずにServer.MapPath()を使用する必要があります。
私の質問を閉じるために投票してください。答えは@ asp.netです-私のパスは仮想ですか?。
URIが有効な仮想パスであるかどうかを判断する機能はありますか?文字列が与えられ、文字列が有効な仮想パスでない場合、例外をスローせずにServer.MapPath()を使用する必要があります。
私の質問を閉じるために投票してください。答えは@ asp.netです-私のパスは仮想ですか?。
メソッドを使用してFile.Exists() and Directory.Exists()
、出力をチェックServer.MapPath()
し、指定したパスにファイル/ディレクトリが存在することを確認できます。
Dim myPath as String = Server.MapPath('/some/path.aspx')
If File.Exists(myPath) Then
//Do Something
Else
If Directory.Exists(myPath) Then
//Do Something
Else
//Invalid path
End If
End If