共 46 篇文章 |
|
C# Tipsc#中如何将"65"这个字符串转换成整数65,或者是将整数65转换成字符串"65"System.Convert.ToInt32( "65 ") System.Convert.ToString(65) 阅123 转0 评0 公众公开 10-12-21 10:20 |
C#目录复制/** FileSystem class: filesystem utility class*/// </summary> public class FileSystem{ // Copy directory structure recursively public static void copyDirectory(string Src,string Dst){ String[] Files;if(Dst[Dst.foreach(string Element in Files){ // Sub directories if(Directory.Exists(Element)) ... 阅196 转0 评0 公众公开 10-12-14 17:43 |
C#嵌套类的使用方法及特性嵌套类(Nested Class)是在类中定义的类。/*嵌套类 定义*/ private class NestedA { public NestedA(A a) { a._a = 9; } } } 继承 继承类,也就是继承类外部类的类,只能使用父类中... 阅551 转3 评0 公众公开 10-12-14 17:17 |
Access查询之Linq to DataSetLinq核心的组成部分有LINQ to SQL, LINQ to DataSet, LINQ to Entities和LINQ toXML,根据Linq对于其他的集成很快会由微软或第三方实现,而改技术对于Access数据库的支持并没有像SQLServer那么友好,今天尝试用Linq查询Access数据文件时遇到了不少麻烦,在网上搜索后发现很多朋友都遇到了相同的问题,经过反复的... 阅268 转0 评0 公众公开 10-12-11 23:12 |
NET Development with NAnt.NAnt supplies a series of default properties available to any project, from nant-specific information (like nant.version, nant.filename) to .<target name="clean"><nant buildfile="businessLogic/default.build" target="clean"/><nant buildfile="we... 阅57 转0 评0 公众公开 10-12-10 22:46 |
public delegate void MyDelegate(string mydelegate);//实现有相同参数和返回值的函数 public void HelloDelegate(string mydelegate) { Console.WriteLine(mydelegate); }MyDelegate mydelegate = new MyDelegate(testClass.//产生delegate对象 mydelegate("Hello delegate");//调用。... 阅191 转3 评0 公众公开 10-12-08 17:24 |
先来看GetSum这个方法,返回值为int,接受两个int型的参数...如果前面说的你都明白了,那么你一定很清楚GetSum就是作为客户端的"回调函数"用来作为参数的.这个函数实现了两个参数是相加并返回其和的业务逻辑.在Main函数中,调用SubClass类的SubAll方法,将Programe类的GetSum方法的引用作为参数传递到SubAll方法中,也就是在SubAll中调用Ge... 阅5365 转21 评1 公众公开 10-12-08 17:16 |
Retrieving Resources with the ResourceManager ClassRetrieving Resources with the ResourceManager Class.You can use the ResourceManager Class to retrieve embedded resources (resources that have been compiled into an application or class library) at run time.Each instance of the ResourceManager class is associated with ... 阅63 转0 评0 公众公开 10-12-07 18:26 |
How To Load an Embedded Resource From A DLL.Library.dll, and no SouthernStates.xml file. To check if the XML file is in the DLL open a plain text editor and open the DLL the file was embedded in. The file embedded should be able to be viewed in plain text with the editor. Here''s a screen shot using Notepad... 阅127 转2 评0 公众公开 10-12-07 18:15 |
C#如何创建和访问资源DLLCreate a "Class Library" project. Remove everything except theAssemblyInfo.cs file from the project.Add your XML and XSD files to the project and set their Build Action toEmbedded ResourceThen compile the project and you should have the resource library.To retrieve the stored resources... 阅631 转0 评0 公众公开 10-12-07 17:42 |