0

这简直太简单了。我有一个处理服务器上文件的网页。我正在尝试调用它,只需在 URL 上发送文件名即可启动它,但它只是调用通知 URL 而不是调用我的参数。我究竟做错了什么?

    private void Notify(IDictionary config, String fn)
    {

        //check to see if a notification url was specified
        if (string.IsNullOrEmpty((String)config["notificationUrl"]))
        {
            log.Warn("No 'notificationUrl' specified. No notification generated.");
        }
        else
        {

            WebRequest wr = WebRequest.Create(string.Format(config["notificationUrl"].ToString() + "?file=" + fn));
            wr.Method="GET";

            HttpWebResponse hwr = (HttpWebResponse)wr.GetResponse();
            if (hwr.StatusCode != HttpStatusCode.OK)
                throw new Exception("Upload File created, but HTTP notification url returned status code: " + hwr.StatusCode.ToString());
        }
    }
4

0 回答 0