public String GetCpuInfo()
{
//得到cpu信息
string CPUInfo = "";
ManagementClass mc = new ManagementClass("Win32_Processor");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
CPUInfo = mo.Properties["ProcessorId"].Value.ToString();
}
return CPUInfo;
}
public string GetHDInfo()
{
//获取硬盘信息
string HDInfo = "";
ManagementClass mc = new ManagementClass("Win32_DiskDrive");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
HDInfo = (string)mo.Properties["Model"].Value;
}
return HDInfo;
}
public static void GetMacAddress()
{
//获取网卡硬件地址
string MacAddress = "";
ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
if ((bool)mo["IPEnabled"] == true)
MacAddress = mo["MacAddress"].ToString();
mo.Dispose();
}
return MacAddress;
}
WinForms中如果进行大规模计算,或者进行后台网络通信/下载的时候,因为要等待事件的完成,所以会造成假死的现象。
可以用两种方法解决:
Firstly,使用多线程。单独开设一个线程,异步调用。这样就不占用界面的线程。从而避免了界面假死。
Secondly,使用BackgoundWorker类,其实也是使用单独的线程,但是M$把要做的东东封装成一个类了:)
深深佩服.Net Framework噶多的类。。。功能是如此强大!
Two methods.
Method 1、
string sql=”insert into………………”;
string sql2 = “select @@identity as ‘lastid’”;
try
{
OpenConnection();
SqlCommand=objSqlCommand = new SqlCommand(sql, objSqlConnection);
objSqlCommand.ExecuteNonQuery();
SqlDataAdapter=objSqlDataAdapter = new SqlDataAdapter(sql2, objSqlConnection);
DataSet=objDataSet = new DataSet();
objSqlDataAdapter.Fill(objDataSet, “identity”);
String num = objDataSet.Tables["identity"].Rows[0]["lastid"].ToString();
CloseConnection();
return int.Parse(num);
}
catch (Exception ex)
{
throw new ApplicationException(“查询ID出错n” + ex.Message);
}
Methods 2、(From CSDN)
if you are using ms sql server
…
sqlcommand.CommandText = ”INSERT INTO sometable (filed1) VALUES (@filed1);”
+” SELECT @ID = @@identity ”;
sqlcommand.Parameter.Add(“@field1″, …);
…
sqlcommand.Parameter.Add(“@ID”, SqlDbType.Int, 4).Direction = ParameterDirection.Output;
sqlcommand.ExecuteNonQuery();
int id = cmd.Parameters["@ID"].Value;
好东东还真多哈~~~
一个全新的全功能的职业设计工具,用于创造基于Microsoft Windows平台的丰富、复杂的应用界面。使用Expression Blend, 可以提供更出色的应用软件并提升客户的体验和满意度。Expression Blend包括了与Microsoft Visual Studio 2005的集成性,让设计者(designers)和开发者(developers)能够更紧密地作为一个团队一起协作!

需要 .NET Framework 3.0支持。
建议配置:
2 GHz或更高的CPU
1GB 内存
ATi X300 或 GeForce 5600以上级别显卡,256MB显存
1280×1024或更高分辨率的显示设备。
Microsoft® Expression Blend™ 2 is the professional design tool used to create engaging Web-connected experiences for Microsoft® Windows®. The Expression Blend 2.5 June 2008 Preview allows you to create Microsoft® Silverlight™ 2-based applications.
We are pleased to present our next preview of Microsoft® Expression Blend™ .
Use Expression Blend 2.5 to create and modify managed Silverlight 2-based applications. Expression Blend for Silverlight 2 includes all of the features in Expression Blend 2 but has not reached the quality level of Expression Blend 2 for WPF or Silverlight 1 development.
Expression Blend 2.5 June 2008 Preview (build 2.1.1113.0) has been updated to work with the Microsoft .NET Framework 3.5 Service Pack 1 Beta. To determine which build of Expression Blend 2.5 you have installed, on the Help menu, click About Microsoft Expression Blend.
Find out more about what’s new in this preview…
Help us improve Expression Blend 2.5 by reporting any technical issues. For more insight into Expression Blend, please see the Expression team blog.
Installation Instructions
View Readme…
- Install the .NET Framework 3.5 first before you install Expression Blend 2.
- Install Expression Blend 2.5 June 2008 Preview* (25 megabytes)
System Requirements
- Supported Operating Systems: Windows Vista; Windows XP Service Pack 2
Recommended system:
- 2 GHz or faster processor
- 1 GB RAM or more
- 10 MB of available hard-disk space
- 1024 x 768 or higher-resolution monitor running at 24-bit color depth or higher
- Microsoft Windows® XP with Service Pack (SP) 2 or later, or Windows Vista (all editions)
更多信息:
http://www.microsoft.com/downloads/details.aspx?FamilyID=32a3e916-e681-4955-bc9f-cfba49273c7c&DisplayLang=en
官网:
http://www.microsoft.com/expression
官方下载:
http://download.microsoft.com/download/8/5/8/858627dc-9aa3-4f86-bb3d-729204927da3/Blend.en.msi