0

これを次のURLに書き込むと、なぜだろうと思います:http://ServerNameRedacted/IISHostedCalcService/FilesService.svc/GetFoldersAndFiles?selectedFolder=FOLDER//SUBFOLDER

XMLで情報を取得できません。

しかし、これを使用すると、FOLDER//SUBFOLDERとまったく同じ関数のパラメーターが機能しません...

文字列で直接書くとうまくいきます。パラメータがまったく同じなので、理由はわかりません...

string.formatなどを使用する必要がありますか?

    void listBoxFolders_Tap(object sender, GestureEventArgs e)
    {
      
        Folder directory = new Folder();


        directory = (Folder)listBoxFolders.SelectedItem;
              
        
        // Connexion to the webservice to get the subfolders and also the files
        WebClient wc = new WebClient();
        wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(wc_DownloadSubFoldersAndFiles);
        wc.DownloadStringAsync(new Uri("http://myserver.net/IISHostedCalcService/FilesService.svc/GetFoldersAndFiles?selectedFolder=" + directory.FullPath.Substring(25) + '/'));
    }
4

1 に答える 1

2

コードのURIの最後にスラッシュを追加していることを考えると、実際には同じではないことを提出します。

メソッドの外部でURI文字列を作成し、DownloadStringAsyncaaSystem.Diagnostics.Debug.WriteLineを使用してURI文字列の実際の内容を確認します。

于 2012-04-17T12:52:53.770 に答える