点滴积累(2011-07-20)
1 修改SQL2005 SA帐号密码的方法
工作中遇到SA帐号密码忘记的问题,后来一个同事说了一个解决办法:
只要执行以下的SQL语句即可:exec sp_password null,'sa123','sa'
(意思是把sa的帐号密码修改为sa123)。
2 远程桌面登录弹出连接数达到最大,此时会一直登录不上,可以运行这个命令 mstsc /console。具体操作:
打开 运行 输入 mstsc /console 命令,按回车,打开远程登录界面。此时去登录不爱最大数的限制了。
3 ORACLE Decode 使用示例:
select Decode(5, 1, '定制操作', 2, '退定操作', '未知类型') AS 操作类型 from dual
详细用法参照 http://www.cnblogs.com/chhuic/archive/2011/07/20/2111323.html
01.拷贝程序文件.bat
CLS
MD Bin
MD Bin\Common
MD Bin\Bin2005
MD Bin\Bin2008
XCOPY ..\..\..\BIN\RM\Common Bin\Common /E /R /Y
XCOPY ..\..\..\BIN\RM\Bin2005 Bin\Bin2005 /E /R /Y
XCOPY ..\..\..\BIN\RM\Bin2008 Bin\Bin2008 /E /R /Y
RD Bin\DBUpdate /S /Q
DEL Bin\CHS\R810RMCC.mdb
DEL Bin\CHS\RMCC_Access.ini
DEL Bin\ENU\R810RMCC.mdb
DEL Bin\ENU\RMCC_Access.ini
02.删除安装多余文件.bat
CLS
RD bin /S /Q
RD Media /S /Q
03.编译版本.bat
"D:\Program Files\Macrovision\IS11.5\System\IsCmdBld.exe" -p "ViewPoint RM R860.ism"
/// 将str字符串转换为 数组 并返回。
/// </summary>
/// <remarks>返回转换后的uint数组。</remarks>
/// <param name="str">字符串 需要转换为 uint 类型数组的字符串。</param>
/// <returns>返回转换后的 数组。</returns>
public static uint[] ConvertStringToUInt32Array(string str)
{
if (!string.IsNullOrEmpty(str))
{
return Array.ConvertAll(str.ToString().Split('.'), (Converter<string, UInt32>)Convert.ToUInt32);
}
return null;
}
/// <summary>
/// Get PhysicalPath by path.
/// 获取制定文件路径的物理路径。
/// </summary>
/// <param name="path">文件 的 路径 [非物理路径]</param>
/// <returns>返回 该路径 path 所在盘的物理路径。</returns>
public static string GetPhysicalPath(string path)
{
return System.Web.Hosting.HostingEnvironment.MapPath("~/" + path);
}
/// <summary>
/// 序列化
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="filepath">文件路径</param>
/// <param name="obj"></param>
public static void Serialize<T>(string filepath, T obj)
{
XmlSerializer mySerializer = new XmlSerializer(typeof(T));
StreamWriter myWriter = new StreamWriter(filepath);
try
{
mySerializer.Serialize(myWriter, obj);
}
catch (Exception)
{
throw;
}
finally
{
myWriter.Close();
myWriter.Dispose();
}
}
/// <summary>
/// 反序列化
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="filepath">文件路径</param>
/// <returns></returns>
public static T Deserialize<T>(string filepath)
{
T obj;
XmlSerializer mySerializer = new XmlSerializer(typeof(T));
FileStream myFileStream = new FileStream(filepath, FileMode.Open);
try
{
obj = (T)mySerializer.Deserialize(myFileStream);
}
catch (Exception)
{
throw;
}
finally
{
myFileStream.Close();
myFileStream.Dispose();
}
return obj;
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
.black_overlay{
display: none;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: white;
z-index:1001;
-moz-opacity: 0.8;
opacity:.80;
filter: alpha(opacity=80);
}
.white_content {
display: none;
position: absolute;
top: 45%;
left: 35%;
width: 20%;
height: 5%;
padding: 16px;
border: 16px solid #c2e6f3;
background-color: white;
z-index:1002;
overflow: auto;
}
-->
</style>
<script language="javascript">
function opendiv(lixing){
document.getElementById('light').style.display='block';
if(lixing==0)
document.getElementById('fade').style.display='block';
}
function colsediv(lixing){
document.getElementById('light').style.display='none';
if(lixing==0)
document.getElementById('fade').style.display='none';
}
</script>
</head>
<body>
<p>可以根据自己要求修改css样式<a href = "javascript:void(0)" onclick = "opendiv(0)">点击这里打开窗口(不充许)</a></p>
<p>可以根据自己要求修改css样式<a href = "javascript:void(0)" onclick = "opendiv(1)">点击这里打开窗口(充许)</a></p>
<div id="light" class="white_content">This is the lightbox content. <a href = "javascript:void(0)" onclick = "colsediv(0)">Close</a></div>
<div id="fade" class="black_overlay"></div>
</body>
</html>
作者:chhuic
出处:http://chhuic.cnblogs.com
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。