做了一个DLL管理工具,很简陋,主要功能如下:
1,将常用的DLL统一管理,放在同一个目录下。 2,添加DLL时自动附上版本号。 3,简单的搜索功能。4,打开DLL所在目录。
该工具的目的:管理自己常用的DLL,以防需要用时不知道放哪了。
工具仅做了简单测试,很多功能还没有做,以后有空会加上,
源码下载地址:DLL管理工具源码
部分代码:
FileInfo fi = new FileInfo(lblFilePath.Text);
string fileExt = FileUtil.GetFileExtension(lblFilePath.Text);
string fileNameWithoutExt = FileUtil.GetFileNameWithoutExt(lblFilePath.Text);
string newFileName = string.Concat(fileNameWithoutExt, txtVersion.Text, fileExt);
string fullFileName = Path.Combine(DllManagerConstants.DllPath, newFileName);
bool isFileExists = File.Exists(fullFileName);
if (isFileExists)
{
if (MessageBox.Show("该文件已存在,是否覆盖?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.No)
{
return;
}
}
FileUtil.CopyFileTo(lblFilePath.Text, fullFileName,true);
string fileNameWithoutExt = FileUtil.GetFileNameWithoutExt(lblFilePath.Text);
string newFileName = string.Concat(fileNameWithoutExt, txtVersion.Text, fileExt);
string fullFileName = Path.Combine(DllManagerConstants.DllPath, newFileName);
bool isFileExists = File.Exists(fullFileName);
if (isFileExists)
{
if (MessageBox.Show("该文件已存在,是否覆盖?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.No)
{
return;
}
}
FileUtil.CopyFileTo(lblFilePath.Text, fullFileName,true);
该工具需要 NET Framework 3.5 才能正常运行。