ASP.NET MVC アプリから、リモート サーバー パスとデータベースから抽出されたパスの 2 つのパスを連結しようとしています。私は以下で実行しています:
string serverPath = @"\\myServer\TempFolder";
string filePath = GetPathFromDatabaseTable();
string finalPath = System.IO.Path.Combine(serverPath, filePath);
GetPathFromDatabaseTable メソッドは次の文字列を返します。
\\path\\to\\file.pdf
Path.Combine を使用して連結すると、結果は次のようになります。
\\path\\to\\file.pdf
したがって、プレフィックス serverPath \myServer\TempFolder は削除されます。なぜ起こっているのですか?