草庐IT

fileNotFoundException

全部标签

c# - FileNotFoundException 从 Windows 应用商店应用程序的 Assets 文件夹中读取 JSON 文件

我正在尝试从我的Assets文件夹中读取一个json文件。我试过很多代码示例,但都是同一件事的变体。我觉得我一定在做一些愚蠢的事情,但我就是看不到。stringfilepath=@"Assets\resources.json";StorageFolderfolder=Windows.ApplicationModel.Package.Current.InstalledLocation;StorageFilefile=awaitfolder.GetFileAsync(filepath);//errorherevardata=awaitWindows.Storage.FileIO.ReadT

java - 在 java 中加载 freemarker 模板时出现 FileNotFoundException

我在加载freemarker模板时遇到找不到文件的异常,即使该模板实际上存在于路径中。更新:这是作为网络服务运行的。它会根据搜索查询向客户端返回一个xml。当我从另一个Java程序(从静态主程序)调用它时,模板加载成功。但是当客户端请求xml时,会发生FileNotFoundException。操作系统:Windows7文件的绝对路径:C:/Users/Jay/workspace/WebService/templates/这是我的代码:privateStringtemplatizeQuestion(QuestionResponseqr)throwsException{SimpleHas

java - 检测 java.io.FileNotFoundException 的根本原因

FileNotFoundException在各种情况下都会被抛出-不一定只在文件名无效时,而且在e.G。权限不允许创建或读取文件:java.io.FileNotFoundException:\\server\share\directory\test.csv(Anmeldungfehlgeschlagen:unbekannterBenutzernameoderfalschesKennwort)atjava.io.FileOutputStream.open(NativeMethod)atjava.io.FileOutputStream.(FileOutputStream.java:179)

java - Android 版本 > 2.3 上的 FileNotFoundException

我尝试将文件下载到手机的SD卡中。在Android2.1、2.2和2.3上一切正常,但在Android4.0上(在模拟器和我的GalaxyNexus上测试)它抛出一个FileNotFoundException。堆栈跟踪:02-2721:49:06.733:W/System.err(27648):java.io.FileNotFoundException:http://www.wdr.de/wdrlive/media/wdr5.m3u02-2721:49:06.733:W/System.err(27648):atlibcore.net.http.HttpURLConnectionImpl

带有西里尔字符的文件路径的 Java java.io.filenotfoundexception

我有一个文件,其名称不仅包含普通ASCII字符集中的字符,还包含非ASCII字符集中的字符。在我的例子中,它包含西里尔字符。这是我的代码片段:StringfileName="/Users/dnelepov/Downloads/тестизображение.png";FilesendFile=newFile(fileName);if(sendFile.exists()){//Somecode}sendFile.existsifblock中的代码没有被执行。为什么无法识别文件?我的系统配置区域设置LANG="ru_RU.UTF-8"LC_COLLATE="ru_RU.UTF-8"LC_C

c# - 系统.IO.FileNotFoundException : Could not load file or assembly 'X' or one of its dependencies when deploying the application

我在部署应用程序时遇到了一个奇怪的问题,该应用程序引用了一个用托管C++编写的程序集。我创建了一个程序集X,对其进行编译并在名为Starter的exe文件中引用它。Starter.exe在本地机器上正常启动。但是,当我将启动器调试文件夹的所有内容复制到虚拟机器并尝试在那里启动它时,它崩溃并出现以下异常:UnhandledException:System.IO.FileNotFoundException:Couldnotloadfileorassembly'X'oroneofitsdependencies.Thespecifiedmodulecouldnotbefound.这对我来说没有

c# - XmlSerializer 在构造函数中给出 FileNotFoundException

当我尝试序列化类型时,我一直在使用的应用程序失败了。像这样的语句XmlSerializerlizer=newXmlSerializer(typeof(MyType));产生:System.IO.FileNotFoundExceptionoccurredMessage="Couldnotloadfileorassembly'[ContainingAssemblyofMyType].XmlSerializers,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null'oroneofitsdependencies.Thesystemcannot

java - 为什么 FileNotFoundException 在 Linux 上存在时被抛出

这是我第一次在Linux上通过Java访问文件遇到这样的问题。问题就像header所说-FileNotFoundException当文件实际存在时抛出。此外,具有相同配置(props.txt文件)的应用程序可以像在Windows上一样运行。让我提供一点控制台输出datasu@dedi2392:~/netcrawler/dkpto$ls-ltotal20-rwxrw-rw-1datasudatasu114Aug715:53autoupdatedrwxr-xr-x4datasudatasu4096Aug811:57datadrwxr-xr-x2datasudatasu4096Aug811:

android - 无法更新 Android Studio - 拒绝访问和 java.io.FileNotFoundException

我正在尝试在两台不同的Windows机器上将AndroidStudio从0.5.1更新到0.5.2,一台使用Windows7Pro64位,另一台使用Windows7Enterprise64位。我得到正常的更新提示:...如果我选择“更新并重新启动”,补丁下载并退出IDE,但随后出现以下对话框:我无法更改任何“解决方案”列条目。如果我点击“继续”,我会收到如下所示的消息(图像和文本,所以它的复制/粘贴/搜索友好):Temp.directory:C:\Users\Sean\AppData\Local\Temp\java.io.FileNotFoundException:C:\Program

android - openFileOutput FileNotFoundException

这是我本周的菜鸟问题。我正在寻找更多的一般猜测而不是特定代码,也许希望Android人员正在关注并纠正这一点:Context.openFileOutput的SDK文档说:OpenaprivatefileassociatedwiththisContext'sapplicationpackageforwriting.Createsthefileifitdoesn'talreadyexist.好的,听起来不错。我可以创建一个文件。除了这个方法也会抛出FileNotFoundException,所以显然有些不对劲。如果找不到文件,为什么应该创建文件的函数会在找不到文件时抛出异常???有点打败了