-1

したがって、私の文字列に何か問題があるに違いありません。

次のように表示される SQL データベースから値を取得しています。

while (reader.Read())
{
    // Row Values
    // 0 = UID
    // 1 = CreatedDate
    // 2 = Location
    documentID = reader.GetGuid(0);
    fileName = reader.GetSqlValue(0).ToString() + ".zip";
    location = reader.GetString(2);
    createdDate = reader.GetDateTime(1);

データベースから返される値は次のとおりです。

GUID: DC5A30D7-D528-4BA4-AA5A-5ECEB2CD9006
fileName: DC5A30D7-D528-4BA4-AA5A-5ECEB2CD9006.zip
Location: \\192.168.22.1\documentation


if (!DoesFileExist(location + fileName))
{
    // Log error to database
}

static bool DoesFileExist(string location)
        {
            bool doesExist = false;
            if (File.Exists(location))
            {
                doesExist = true;
            }

            return doesExist;
        }

File.Exists(location) の部分に到達すると、存在しないかのように通過します。それはそうです...エクスプローラーでナビゲートすると、zipファイルがうまく見つかります...

ここで何が間違っていますか?

UID CreatedDate Location
DC5A30D7-D528-4BA4-AA5A-5ECEB2CD9006    2009-10-28 11:17:06.690 \\192.168.22.1\documentation
4

3 に答える 3