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。加上即问题解决。

  • 相关阅读:
    记第一场省选
    POJ 2083 Fractal 分形
    CodeForces 605A Sorting Railway Cars 思维
    FZU 1896 神奇的魔法数 dp
    FZU 1893 内存管理 模拟
    FZU 1894 志愿者选拔 单调队列
    FZU 1920 Left Mouse Button 简单搜索
    FZU 2086 餐厅点餐
    poj 2299 Ultra-QuickSort 逆序对模版题
    COMP9313 week4a MapReduce
  • 原文地址:https://www.cnblogs.com/cubean/p/2303540.html
Copyright © 2011-2022 走看看