摘要:
// 代理实现异步调用以设置richTextBox控件text属性
delegate void SetTextCallback(string text);
// 如果调用线程和创建TextBox控件的线程不同,这个方法创建
// 代理SetTextCallback并且自己通过Invoke方法异步调用它
// 如果相同则直接设置Text属性
private void SetText(string text)
{
// InvokeRequired需要比较调用线程ID和创建线程ID
// 如果它们不相同则返回true
if (this.tbxMessage.InvokeRequired)
{
if (!this.IsDisposed)
{
SetTextCallba 阅读全文
摘要:
1>
MyTestHanader tt = new MyTestHanader(MyTestMethod);
TestMethod(tt);
2>
TestMethod(new MyTestHanader(MyTestMethod));
3>
TestMethod(MyTestMethod);
阅读全文
摘要:
原文:http://blog.163.com/henan_lujun/blog/static/19538333200781324449126/隔了这么多天,终于炮制出了自己关于.NET Remoting技术在项目中的应用总结。 2、Remoting技术的应用 根据需求,我们的系统必须以C/S方式构建,而且是三层架构,这样一来,就出现了服务器端和客户端通信的问题。 为了解决双方的通信问题,还要考虑... 阅读全文
摘要:
C#实现快捷键(系统热键)响应 http://blog.sina.com.cn/s/blog_53864cba0100ch2j.html 在应用中,我们可能会需要实现像Ctrl+C复制、Ctrl+V粘贴这样的快捷键,本文简单介绍了它的实现,并给出了一个实现类。 (1)建立一个类文件,命名为HotKey.cs,代码如下: using System; using System.Collectio... 阅读全文
摘要:
序列化对象
XmlSerializer mySerializer = new XmlSerializer(typeof(SearchData));
// To write to a file, create a StreamWriter object.
StreamWriter myWriter = new StreamWriter("c:\\searchData.xml");
mySerializer.Serialize(myWriter, SearchDataCtrlObj.CurrentSearchData);
myWriter.Close();
反序列化对象
SearchTextCollectionBaseData initSearchTextCollection;
XmlSerializer mySerializer = new XmlSerializer(typeof(SearchTextCollectionBaseData));
FileStream myFileStream = new FileStream(InitSearchConditionP 阅读全文
摘要:
Select * FROM (
select ROW_NUMBER()Over(order by cf_id desc) as rowId,* from T_Test
) as mytable
where rowId between 21 and 40 阅读全文
摘要:
OCI:20053 溢出错误
SELECT TO_CHAR(1/3) FROM DUAL;
SELECT ROUND(1/3,16) FROM DUAL;
阅读全文
摘要:
exp system/a@orcl File=(F:\faisdb01.dmp,F:\faisdb02.dmp,F:\faisdb03.dmp,F:\faisdb04.dmp) filesize=3000M owner=fais
imp system/a@orcl File=(F:\faisdb01.dmp,F:\faisdb02.dmp) fromuser=fais touser=fais statistics=none
阅读全文
摘要:
webservice使用的是独立进程,而singleton模式在同一进程中好用,不同进程中将加载为不同对象,请勿混淆! 阅读全文
摘要:
RegistryKey KeyCon=Registry.LocalMachine.OpenSubKey( "Software\\Microsoft\\Windows\\CurrentVersion\\Run",true);
string MyKey= "Terminal"; if((string)KeyCon.GetValue(MyKey,"no") == "no")//指定的键不存在
{ string Path = Application.StartupPath+@"\Terminal.exe"; KeyCon.SetValue(MyKey,Path);
//设置注册表中的启动键 }
阅读全文