摘要:
string str1 =Process.GetCurrentProcess().MainModule.FileName;//可获得当前执行的exe的文件名。string str2=Environment.CurrentDirectory;//获取和设置当前目录(即该进程从中启动的目录)的完全限定路径。//备注 按照定义,如果该进程在本地或网络驱动器的根目录中启动,则此属性的值为驱动器名称后跟一个尾部反斜杠(如“C:\”)。如果该进程在子目录中启动,则此属性的值为不带尾部反斜杠的驱动器和子目录路径(如“C:\mySubDirectory”)。string str3=Directory.GetC
阅读全文
posted @ 2012-10-15 15:08
starstudio
阅读(191)
推荐(0)
摘要:
Net中的反射(反射特性)Attribute2009-09-03 18:09可能很多人还不了解特性,所以我们先了解一下什么是特性。想想看如果有一个消息系统,它存在这样一个方法,用来将一则短消息发送给某人:// title: 标题;author:作者;content:内容;receiverId:接受者Idpublic bool SendMsg(string title, string author,...
阅读全文
posted @ 2010-07-06 14:12
starstudio
阅读(307)
推荐(0)
摘要:
充分利用界面上的空间,是优秀软件界面布局设计的原则之一。如果布局上出现了大片的空白区域就会给人一种浪费和不谐调的感觉。如下图所示。我们把ListBox的ItemsPanel设置为一个WrapPanel。让里面的Items可以自动折行。但是这样在ListBox的右侧,会出现一块空白区。很多情况下,我们对于Item的大小并不很在意,这时我们会更希望Item的宽度可以随着整体宽度自动地调节。产生如下图所...
阅读全文
posted @ 2010-03-04 14:23
starstudio
阅读(1634)
推荐(0)
摘要:
Windows Presentation Foundation (WPF) 提供了一组服务,这些服务可用于扩展公共语言运行时 (CLR) 属性的功能,这些服务通常统称为 WPF 属性系统。由 WPF 属性系统支持的属性称为依赖项属性。 这段是MSDN上对依赖属性(DependencyProperty)的描述。主要介绍了两个方面,WPF中提供了可用于扩展CLR属性的服务;被这个服务支持的属性称为依...
阅读全文
posted @ 2010-02-25 15:36
starstudio
阅读(296)
推荐(0)
摘要:
1.关联(Association)类之间的关联大多用来表示变量实例持有着对其他对象的引用。Phone拥有一个对Button的引用。2.聚合(Aggregation)聚合是关联的一种特殊形式,它意味着一种整体/部分(whole/part)的关系。一个整体不能是它自己的一部分。 因此 ,实例不能形成聚合回路,一个单独的对象不能够成为它自己的聚合,两个对象不能互相聚合,三个对象不能形成一个聚合环。下图为...
阅读全文
posted @ 2010-02-25 10:34
starstudio
阅读(942)
推荐(0)
摘要:
泛型集合List DotBlogs Tags: C# 1 人收藏 我要推薦 | 閱讀數 : 494 | Category: C# | 訂閱 相信大家有用過List的都知道他的魔力,Generic 這個類別是從C#2.0所新增的類別,在C# 3.0的又多了更強大的功能。讓我們可以更輕鬆更偷懶的寫出比2.0少寫幾行Code的敘述句。我簡單的紀錄一下以免我又忘記怎麼使用了。使用List前要記得先引用 u...
阅读全文
posted @ 2009-11-23 10:11
starstudio
阅读(210)
推荐(0)
摘要:
begin transactionUPDATE b SET b.content=a.contentFROM (select max(goodscode) as goodscode,content ,styleid from t_d_goods group by styleid,goodsid,status,content having content is not null and status&...
阅读全文
posted @ 2009-11-22 11:12
starstudio
阅读(194)
推荐(0)
摘要:
private void ResetColor(Control controls) { foreach (Control control in controls.Controls) { if (control.HasChildren) { ResetColor(control); } else if (control is Label) { control.ForeColor = System.D...
阅读全文
posted @ 2009-11-22 11:09
starstudio
阅读(220)
推荐(0)
摘要:
System.Reflection.Assembly ass; ass = System.Reflection.Assembly.LoadFile("d:\\TestReflect.dll"); type = ass.GetType("TestReflect.ReFlectTestStudy"); obj = ass.CreateInstance("TestReflect.ReFlectTestS...
阅读全文
posted @ 2009-11-22 11:07
starstudio
阅读(474)
推荐(0)
摘要:
-public static DataSet GetQuestionsBySubject(string subject){ if (string.IsNullOrEmpty(subject)) return null; StringBuilder strb = new StringBuilder("select * from Question where subject like '%'+@sub...
阅读全文
posted @ 2009-11-22 11:05
starstudio
阅读(736)
推荐(0)