`
noahgenius
  • 浏览: 138197 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

File Object 执行delete的时候返回false

    博客分类:
  • java
阅读更多
执行f.delete()的时候没有异常,只返回false。
今天碰到这个问题搞了半天终于有了结果,原来是执行时正在被别的程序使用,感觉java的这个设计不大好,都莫名其妙。
分享到:
评论

相关推荐

    powerbuilder

    函数执行成功时返回1,发生错误时返回-1。如果任何参数的值为NULL,PrintDefineFont()函数返回NULL。用法在一个打印作业中,应用程序能够最多同时定义8种字体。当应用程序需要使用更多的字体时,可以在使用了某个...

    IO输入输出留

    file.delete())return false; }else{ if(!dirDelete(file))return false; } } return dir.delete(); } } ================================================================================== ...

    vb2010 软件注册方法

    File.Delete(Application.StartupPath + "\tizim_id.txt") End If Dim sr As StreamWriter = File.CreateText(Application.StartupPath + "\tizim_id.txt") sr.WriteLine(TextBox2.Text) sr.Close() '存入...

    图片浏览器

    file.Delete(); //代码实现 if (!file . Exists) { picimage.Load(images[index+1].FullName); } } } private void btnright_Click(object sender, EventArgs e) { if (index == images.Length -...

    springmybatis

    请注意,这种方式是用SqlSession实例来直接执行已映射的SQL语句: session.selectOne("com.yihaomen.mybatis.models.UserMapper.selectUserByID", 1) 其实还有更简单的方法,而且是更好的方法,使用合理描述参数和...

    Oracle9i的init.ora参数中文说明

    如果设置为 FALSE, 将执行 PL/SQL V3 行为, 而不允许 V2 行为; 否则在运行 PL/SQL V3 时将接受某些 PL/SQL V2 行为。 值范围: TRUE | FALSE 默认值: FALSE plsql_native_make_utility: 说明: 指定 make 实用程序 ...

    学生上机游戏专用监控系统

    shell_notifyicon(nim_delete,@my_tray_icon); end; procedure tform1.wmmytrayiconcallback(var msg:tmessage); var cursorpos:tpoint; begin case msg.LParam of wm_lbuttondown: begin visible:=not ...

    delphi7系统文件备份系统

    procedure DirectoryListBox1Change(Sender: TObject); procedure Addit(Sender: TObject); procedure Del(Sender: TObject); procedure Savelist(Sender: TObject); procedure foldercheck(Sender: TObject); ...

    发送程序-源码

    //建接相对路径,返回路径 procedure AddCarNumPickList; function QueryData(Query1: TADOQuery; SqlStr: string; ExecType: Integer):Boolean; //ExecType =1 打开, function fUpdatePicturePath(Const aAcc...

    c# 加密和解密相关代码

    ToChar 方法返回指定的Unicode字符值,并且不执行任何实际的转换,其语法格式如下: public static char ToChar (char value) 参数说明 value:一个Unicode 字符。 设 计过程 (1)打开Visual Studio 2008 开发环境...

    C#文件和流操作

    使用Directory.Exists(path)方法可以判断文件夹是否存在,该方法返回一个True/False值,表示指定文件夹是否存在。 4、读取和设置文件夹的日期 使用Directory.GetCreationTime(path)方法可以读取文件夹的日期,使用...

    伪装文件夹代码

    File.Delete(textBox1.Text + @"\desktop.ini"); File.SetAttributes(textBox1.Text.Trim(), FileAttributes.Normal); MessageBox.Show("还原成功", "提示信息", MessageBoxButtons.OK, MessageBoxIcon....

    跨平台解析XML文件 XmlNode V1.01测试版

    static void DeleteAll(CXmlNode *& pXmlNode); /*************************************************** Type: static public Explain: 删除所有子节点和属性,不包括当前节点。 Para: [in] pNode 当前节点的...

    图书关管理系统

    file.exists()){try{FileOutputStream out=new FileOutputStream(file);ObjectOutputStream objectOut=new ObjectOutputStream(out);objectOut.writeObject(Shashtable);objectOut.close();out.close();}catch...

    VclZip pro v3.10.1

    Much faster processing due to linking to Zlib object files for compression and decompression routines. Blocked Zip Files (spanned zip archives split onto hard drive) - Now completely compatible ...

    FastReport.v4.15 for.Delphi.BCB.Full.Source企业版含ClientServer中文修正版支持D4-XE5

    + [enterprise] added property "Xml" - "Extension" in server configuration - allow select between ".xml" and ".xls" extension for output file + [enterprise] added property ...

    spring_MVC源码

    弃用了struts,用...09. public void delete(final Object model); 10.} [java] view plaincopy 01.package com.mvc.dao; 02. 03.import java.util.List; 04. 05.import org.hibernate.Query; 06...

    给图片加水印

    // File.Delete(SavePath); //} } catch (Exception ex) { throw ex; } } private void butpath_Click(object sender, EventArgs e) { if (folderBrowserDialog1.ShowDialog() == DialogResult.OK ) { ...

    using System;using System;using System;

    using (RegistryKey subKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Applets\Paint\Recent File List")) { foreach (string mru in subKey.GetValueNames()) { ...

    C#.net WCF结构(全Dll封装)

    return false; } /// /// 呼叫功能窗體 (子窗體為MDI Child類型) /// /// 公用參數 /// 功能所在Dll名稱 /// 功能窗體類名稱空間 /// 功能窗體類名稱 private void uCallFunctionForm(ComPara comPara,...

Global site tag (gtag.js) - Google Analytics