摘要: 一.创建dll文件 1.在vs2010中创建Class Library 项目; 2.输入代码using System;namespace myFirstDll{ public class Show { public string Messages() { //定义了一个方法,此方法的作用就是返回下面字符串。 return "欢迎使用Visual Studio 2010 做的DLL文件!" ; } }} 3.按F6编译生成Dll文件(\myFirstDll\bin\Debug\myFirstDll.dll)二.调用dll文件 1.在vs2010中新建普通的Console项目( 阅读全文
posted @ 2011-03-29 21:14 Debuggings 阅读(18670) 评论(2) 推荐(3) 编辑
摘要: This is a class to make an application where only one instance of app can be run at a time in C#. The method must be called inProgram.csby replacing:CollapseApplication.Run(new Form1());withCollapseChico.SingleApp.Initialize(true, new Form1());a shorter version(where this initial code originated fro 阅读全文
posted @ 2011-03-29 19:33 Debuggings 阅读(397) 评论(0) 推荐(0) 编辑
摘要: 作为软件设计和开发人员大都有过使用DLL(动态连接库)的经历,DLL的产生使得我们的应用程序在可维护性、代码的重复使用等方面都有了很大的提高。以前用的DLL一般都是用Visual C++、Delphi或者VB等编程语言来编写的,这种DLL的编写和使用,我们大都已经比较习惯了。作为新一代的程序开发语言--Visual C#,到底是如何编写和使用DLL的呢!本文就试着就这方面的问题来进行简单的介绍。 Visual C++、Delphi或者VB等编程语言来编写成的DLL文件,在编译完成过以后,产生DLL文件已经是一个可以直接供计算机使用的二进制文件。但用Visual C#编译器生成的受管代码(man 阅读全文
posted @ 2011-03-29 19:29 Debuggings 阅读(498) 评论(0) 推荐(0) 编辑