久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<legend id='HJNiy'><style id='HJNiy'><dir id='HJNiy'><q id='HJNiy'></q></dir></style></legend>
  • <tfoot id='HJNiy'></tfoot>
      <bdo id='HJNiy'></bdo><ul id='HJNiy'></ul>
  • <i id='HJNiy'><tr id='HJNiy'><dt id='HJNiy'><q id='HJNiy'><span id='HJNiy'><b id='HJNiy'><form id='HJNiy'><ins id='HJNiy'></ins><ul id='HJNiy'></ul><sub id='HJNiy'></sub></form><legend id='HJNiy'></legend><bdo id='HJNiy'><pre id='HJNiy'><center id='HJNiy'></center></pre></bdo></b><th id='HJNiy'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='HJNiy'><tfoot id='HJNiy'></tfoot><dl id='HJNiy'><fieldset id='HJNiy'></fieldset></dl></div>

    <small id='HJNiy'></small><noframes id='HJNiy'>

        StreamReader 抱怨文件不存在,但確實存在

        StreamReader complains that file does not exist, but it does(StreamReader 抱怨文件不存在,但確實存在)

          <tbody id='yGS8e'></tbody>

          1. <legend id='yGS8e'><style id='yGS8e'><dir id='yGS8e'><q id='yGS8e'></q></dir></style></legend>

              <small id='yGS8e'></small><noframes id='yGS8e'>

            1. <i id='yGS8e'><tr id='yGS8e'><dt id='yGS8e'><q id='yGS8e'><span id='yGS8e'><b id='yGS8e'><form id='yGS8e'><ins id='yGS8e'></ins><ul id='yGS8e'></ul><sub id='yGS8e'></sub></form><legend id='yGS8e'></legend><bdo id='yGS8e'><pre id='yGS8e'><center id='yGS8e'></center></pre></bdo></b><th id='yGS8e'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='yGS8e'><tfoot id='yGS8e'></tfoot><dl id='yGS8e'><fieldset id='yGS8e'></fieldset></dl></div>
              <tfoot id='yGS8e'></tfoot>
                <bdo id='yGS8e'></bdo><ul id='yGS8e'></ul>
                  本文介紹了StreamReader 抱怨文件不存在,但確實存在的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個本地化的應用程序,可以在整個歐洲使用.

                  I have an application that is localized for use across Europe.

                  我有一個從磁盤加載文件的菜單選項.

                  I have a menu option that loads a file from disk.

                  此操作在我的開發機器上運行良好,但在我用于測試其他操作系統的虛擬機上運行 - 例如法語、西班牙語等.

                  This operation works fine on my dev machine but does not work on the virtual machine I use to test other operating systems _ e.g French, Spanish etc.

                  當 StreamReader 嘗試打開文件時會生成 FileNotFoundException.

                  A FileNotFoundException is generated when the StreamReader tries to open the file.

                  它說'找不到文件 C:Program FilesMyCompanyMyToolinFilesdebug.txt'"

                  It says "'Could not find the file C:Program FilesMyCompanyMyToolinFilesdebug.txt'"

                  問題是,該文件確實存在,在正確的位置和正確的文件名.

                  Thing is, the file does exist, at the correct location and with the correct filename.

                  目標(法語)操作系統上的目錄名稱與開發機器上的目錄名稱相同.

                  The directory names on the target (French) operating system are the same as the dev machine.

                  有什么想法嗎?

                  string ourPath =   System.IO.Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName);
                  
                             try
                          {
                              System.IO.StreamReader sr = System.IO.File.OpenText(ourPath + @"inFilesdebug.txt");
                              string input = null;
                              while ((input = sr.ReadLine()) != null)
                              {
                                  m_text.Append(input);
                              }
                              sr.Close();
                          }
                          catch (System.IO.FileNotFoundException)
                          {
                              MessageBox.Show("LoadDebugOptions: File Not Found: " + ex.Message);
                          }
                  

                  推薦答案

                  好的,問題找到了.

                  確定操作系統正在將資源管理器中顯示為debug.txt"的文件讀取為debug.txt.txt".

                  Determined that the operating system was reading the file displayed in explorer as "debug.txt" as "debug.txt.txt".

                  這是通過調用 System.IO.Directory.GetFiles 來列出目標目錄中的文件來確定的.

                  This was determined by using a call to System.IO.Directory.GetFiles to list the files in the target directory.

                  如果我刪除 .txt 擴展名,以便 Windows 資源管理器將其顯示為調試",則找到該文件.

                  If I remove the .txt extension so that windows explorer displays it as "debug" then the file is found.

                  原來資源管理器在目標機器上隱藏了已知類型的文件擴展名.

                  Turns out explorer was hiding file extensions of known types on the target machine.

                  僅供參考 ----------------------------------------------------------------------------

                  FYI ----------------------------------------------------------------

                  打開資源管理器,選擇工具->文件夾選項,然后選擇查看選項卡.

                  Open Explorer, Select Tools->Folder Options then the View Tab.

                  向下滾動并取消選中隱藏已知文件類型的擴展名".

                  Scroll down and uncheck "Hide extensions for Known file types".

                  這篇關于StreamReader 抱怨文件不存在,但確實存在的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Ignore whitespace while reading XML(讀取 XML 時忽略空格)
                  XML to LINQ with Checking Null Elements(帶有檢查空元素的 XML 到 LINQ)
                  Reading XML with unclosed tags in C#(在 C# 中讀取帶有未閉合標簽的 XML)
                  Parsing tables, cells with Html agility in C#(在 C# 中使用 Html 敏捷性解析表格、單元格)
                  delete element from xml using LINQ(使用 LINQ 從 xml 中刪除元素)
                  Parse malformed XML(解析格式錯誤的 XML)

                • <small id='Vfq8c'></small><noframes id='Vfq8c'>

                  • <bdo id='Vfq8c'></bdo><ul id='Vfq8c'></ul>

                        <legend id='Vfq8c'><style id='Vfq8c'><dir id='Vfq8c'><q id='Vfq8c'></q></dir></style></legend>
                        1. <tfoot id='Vfq8c'></tfoot>
                          <i id='Vfq8c'><tr id='Vfq8c'><dt id='Vfq8c'><q id='Vfq8c'><span id='Vfq8c'><b id='Vfq8c'><form id='Vfq8c'><ins id='Vfq8c'></ins><ul id='Vfq8c'></ul><sub id='Vfq8c'></sub></form><legend id='Vfq8c'></legend><bdo id='Vfq8c'><pre id='Vfq8c'><center id='Vfq8c'></center></pre></bdo></b><th id='Vfq8c'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Vfq8c'><tfoot id='Vfq8c'></tfoot><dl id='Vfq8c'><fieldset id='Vfq8c'></fieldset></dl></div>

                            <tbody id='Vfq8c'></tbody>
                            主站蜘蛛池模板: 国产在线观看一区二区三区 | 成人二区 | 99爱在线 | 亚洲男人天堂2024 | 在线精品一区二区三区 | 毛片高清| 中文字幕在线观看 | 久久久www成人免费无遮挡大片 | 国产成人精品一区二区三区四区 | 国产一区二区三区四区 | 美女黄视频网站 | 女同久久另类99精品国产 | xxx.在线观看 | 精品免费看| 日韩网站在线观看 | 成人黄在线观看 | 免费精品 | 日韩国产一区二区三区 | 国产一区二区三区视频 | 亚洲第1页| 亚洲一区久久久 | 日本一区二区三区视频在线 | 天天拍天天射 | 亚洲高清一区二区三区 | 天堂一区在线观看 | 欧美激情黄色 | 国产在线一区二区三区 | 日韩一级在线 | 99热精品在线观看 | 中文字幕第一页在线 | 午夜视频网站 | 久久成人免费 | 一区二区成人 | 在线视频国产一区 | 精品一二区 | 国产成人99久久亚洲综合精品 | 久久久国产一区二区三区 | 国产乱人伦| 毛片一区二区 | 免费视频一区二区三区在线观看 | 成人激情视频在线 |