获取剪切板中的内容 往数据库中导入数据命令 MD5 执行批处理
来源:互联网 发布:ubuntu 忘记系统密码 编辑:程序博客网 时间:2024/06/06 04:33
1. 获取剪切板中的内容
String clipBoardText = null;
if (Clipboard.ContainsText(TextDataFormat.UnicodeText))
{
clipBoardText = Clipboard.GetText(TextDataFormat.UnicodeText);
}
else if (Clipboard.ContainsText(TextDataFormat.Rtf))
{
clipBoardText = Clipboard.GetText(TextDataFormat.Rtf);
}
else if (Clipboard.ContainsText(TextDataFormat.Text))
{
clipBoardText = Clipboard.GetText(TextDataFormat.Text);
}
char[] sp = new char[5];
sp[0] = ' ';
sp[1] = ',';
sp[2] = '\t';
sp[3] = '\n';
sp[4] = '\r';
if (clipBoardText != null)
{
string[] columns = clipBoardText.Split(sp);
}
else
{
MessageBox.Show("不存在粘贴文本!!!");
}
2. 往数据库中导入数据命令
imp userName/userPwd@ServiceName file=fileName full=y ignore=y
full:代表是否全部导入 y是 n否; ignore表示是否忽略错误 y是 n否
3. 密码转换成MD5
private string EncodePassword(string originalPassword)
{
Byte[] originalBytes;
Byte[] encodedBytes;
MD5 md5;
md5 = new MD5CryptoServiceProvider();
originalBytes = ASCIIEncoding.Default.GetBytes(originalPassword);
encodedBytes = md5.ComputeHash(originalBytes);
return BitConverter.ToString(encodedBytes);
}
4. 代码执行批处理程序
private bool callExcutableBatchFile(string currentFPath)
{
try
{
System.Diagnostics.Process process = new System.Diagnostics.Process();
string currentBatFPath = currentFPath + "tmpRestoreData.bat"; //批处理程序文件路径
if (!File.Exists(currentBatFPath))
{
MessageBox.Show("不存在可执行的批处理文件!!!\n路径为:" + currentBatFPath);
return false;
}
FileInfo file = new FileInfo(currentBatFPath);
process.StartInfo.WorkingDirectory = file.Directory.FullName;
process.StartInfo.FileName = currentBatFPath;
process.StartInfo.CreateNoWindow = false;
if (process.Start())
{
process.WaitForExit();
if (process.HasExited)
{
process.Close();
process.Dispose();
}
}
}
catch (Exception ex)
{
}
finally
{ }
}
- 获取剪切板中的内容 往数据库中导入数据命令 MD5 执行批处理
- java执行批处理命令 获取返回 数据
- 如何获取windows剪切板中内容
- 批处理执行sql脚本文件导入数据
- 批处理 清空剪切板批处理命令
- BAT批处理:获取文件名(不含后缀)、执行SQL语句及数据导入
- 编写数据库函数执行循环copy命令导入大数据
- 批处理技巧 批处理获取上一条命令的执行结果
- 批处理技巧 批处理获取上一条命令的执行结果
- Java中使用Oracle的客户端 load data和sqlldr命令执行数据导入到数据库中
- 异地数据库导入数据内容
- Android、IOS 获取剪切板内容
- #GWT#获取剪切板内容-getClipboardData
- c++获取剪切板的内容
- Java 将excel中的内容导入数据库中
- 把文本文件中的内容导入到数据库中
- Java 将excel中的内容导入数据库中
- 把A数据库中的数据导入B数据库中
- C++Primer笔记4(第五章-表达式)
- sqlserver
- CyanogenMod 官方移植指南
- linux下的C语言开发(动态库)
- 如何在登陆页面上显示验证码
- 获取剪切板中的内容 往数据库中导入数据命令 MD5 执行批处理
- LeetCode Unique Binary Search Trees II
- hadoop 2.3.0 HA 配置出现的一个超低级问题
- linux下的C语言开发(定时器)
- [Bzoj1901]Zju2112 Dynamic Rankings
- BCD码
- CUDA基础知识
- linux下的C语言开发(自动编译工具)
- 利用Tomcat的JNDI容器管理JavaMail中的Session