利用反射访问类库中的文件路径并拷贝文件
来源:互联网 发布:b*算法Java 编辑:程序博客网 时间:2024/04/28 16:26
public void CopyDataBase(int num)
{
string codeBase = Assembly.GetAssembly(typeof(DataSynchronizationTest)).CodeBase;
string appPath = codeBase.Replace(@"file:///", string.Empty);
appPath = appPath.Replace(@"/", @"\");
int indexBin = appPath.IndexOf("bin\\");
appPath = appPath.Substring(0, indexBin);
string localPath = appPath + "DbFiles\\" + DataBaseTestConfig.LocalDbFileName(num);
string serverPath = appPath + "DbFiles\\" + DataBaseTestConfig.ServerDbFileName(num);
string localDesPath = System.IO.Directory.GetCurrentDirectory() + "\\DbFiles\\" + DataBaseTestConfig.LocalDbFileName(num);
string serverDesPaht = System.IO.Directory.GetCurrentDirectory() + "\\DbFiles\\" + DataBaseTestConfig.ServerDbFileName(num);
File.Copy(localPath, localDesPath, true);
File.Copy(serverPath, serverDesPaht, true);
}
{
string codeBase = Assembly.GetAssembly(typeof(DataSynchronizationTest)).CodeBase;
string appPath = codeBase.Replace(@"file:///", string.Empty);
appPath = appPath.Replace(@"/", @"\");
int indexBin = appPath.IndexOf("bin\\");
appPath = appPath.Substring(0, indexBin);
string localPath = appPath + "DbFiles\\" + DataBaseTestConfig.LocalDbFileName(num);
string serverPath = appPath + "DbFiles\\" + DataBaseTestConfig.ServerDbFileName(num);
string localDesPath = System.IO.Directory.GetCurrentDirectory() + "\\DbFiles\\" + DataBaseTestConfig.LocalDbFileName(num);
string serverDesPaht = System.IO.Directory.GetCurrentDirectory() + "\\DbFiles\\" + DataBaseTestConfig.ServerDbFileName(num);
File.Copy(localPath, localDesPath, true);
File.Copy(serverPath, serverDesPaht, true);
}
- 利用反射访问类库中的文件路径并拷贝文件
- 利用反射动态获取当前工程下的文件路径_并打成jar包
- Java 利用反射 使用.class文件中的类
- 拷贝文件路径
- 录入文件路径 拷贝
- 利用多线程拷贝文件
- 通过字符串创建对象并访问类中的方法(利用java的反射)
- 文件拷贝并监听
- JavaWeb开发中的文件访问路径
- PHP通过类名 怎么查找 这个类所在的文件 路径?利用PHP反射类
- 自定义类加载器,利用反射加载任意路径下的class文件
- android 处理txt文件类FileUtils,利用java反射机制访问非sdk类和函数
- android 处理txt文件类FileUtils,利用java反射机制访问非sdk类和函数
- 利用XML文件进行类的反射
- 利用C# 实现文件拷贝
- 利用mmap实现文件拷贝
- 利用filechannel拷贝文件内容
- 利用JAVA实现文件拷贝
- IOS开发 关闭虚拟键盘的各种方式
- awk variable quote
- dom4j的全面分析与应用
- Hibernate SQL 方言(hibernate.dialect)
- ASP.NET上传文件的三种基本方法
- 利用反射访问类库中的文件路径并拷贝文件
- 公司成立两个月来,已经推出了好几款ipad上的应用,我们又距离梦想迈进了一步!!! 【西湖天下】已经上线啦,各位好友多多关注哈
- oracle 查看用户权限
- Perl different between numeric and string
- NSURLConnection异步请求
- java——多线程的总结,总结的挺好的
- linux命令ls -al 解析
- 对错误,漏洞和exploits的说明
- Bash Shell 模式匹配操作