zoukankan      html  css  js  c++  java
  • IIS error:The remote server returned an error: NotFound

    近日弄了段以下程序(程序发布在IIS上,程序在运行时要到网站下载文件 ): 

    WebClient client = new WebClient();

    client.DownloadStringCompleted += delegate(object s, DownloadStringCompletedEventArgs de)
    {
                    if (de.Error != null)
                    {
                        LoadingMessage = "An error occured: " + de.Error.Message;
                        return;
                    }
    }

    client.DownloadProgressChanged += delegate(object sender, DownloadProgressChangedEventArgs e)
    {
                    Deployment.Current.Dispatcher.BeginInvoke(delegate()
                    {
                        LoadProgress = e.BytesReceived / (double)e.TotalBytesToReceive;
                    });
    };
    client.DownloadStringAsync(ModelUri);  

    发现,在调试的时候怎么都好使,一旦发布到IIS就有问题。后来用上面代码段跟踪,发现,报Error:“The remote server returned an error: NotFound”;

    如果你出现了这个问题,十有八九就是IIS站点配置的MIME Types缺少了要下载文件的后缀。我的就是缺了个.dae。加上即问题解决。

  • 相关阅读:
    用TextKit实现表情混排
    IOS类似9.png
    iphone 弹出键盘,文本框自动向上移动。
    IOS截取部分图片
    IOS给图片增加水印(图片、文字)
    iOS界面设计切图小结
    table tr th td thead tbody tfoot
    怎样让table没有边框
    margin、padding,border默认值
    Java 随机数
  • 原文地址:https://www.cnblogs.com/cubean/p/2303540.html
Copyright © 2011-2022 走看看