
c#
文章平均质量分 83
johnice
这个作者很懒,什么都没留下…
展开
-
c# lua 简单交互
c# 与 lua 的交互 比较简单, 一下为例子: c# 文件内容: using System;using System.Collections.Generic;using System.Text;using LuaInterface; // lua 封装库namespace lua_test{ class MyClass原创 2009-09-28 17:09:00 · 11071 阅读 · 1 评论 -
C# 属性页 PropertyGrid
using System.Drawing;using System.Text;using System.Windows.Forms;using System.IO;using System.Windows.Forms.Design;using System.Drawing.Design;namespace Quick.Dialog{ public partia原创 2009-09-29 09:43:00 · 3420 阅读 · 0 评论 -
进度条使用
在使用进度条ProgressBar时,一般使用多线程 和 Timer 相结合。 比如在Form_Load中创建新的线程,用于执行你实际要的操作(比如转换文件) Thread thread = new Thread(new ThreadStart(progress));thread.Start(); progress() 函数中为操作内容 然后在Ti原创 2009-09-28 17:30:00 · 1203 阅读 · 0 评论 -
C# 中 调用 Win API 函数
1) [DllImport("user32.dll", EntryPoint = "ShowWindow")] private static extern bool ShowWindow(IntPtr nClientID, int nCmdShow); 2) [System.Runtime.InteropServ原创 2009-10-09 14:23:00 · 603 阅读 · 0 评论 -
c# ListView 双缓存 避免闪烁
在控件构造函数前加上以下5行代码: public class CustomListView : ListView { public CustomListView() { SetStyle(ControlStyles.DoubleBuffer |原创 2009-10-09 14:38:00 · 2488 阅读 · 1 评论 -
C# 中调用 C++编写的 dll 的 调试
以下只是针对VS2005,其他版本没试过 前提: 必须有该dll 的c++源码 断点处代码被运行 c#程序调用c++写的dll: 1. 确保工程为debug,而不是release 2. 将该dll设为启动项 3. 设置该dll的属性,property->debugging->debugger type 为 Native原创 2009-10-28 16:21:00 · 2975 阅读 · 0 评论 -
C#调用非托管DLL
在合作开发时,C#时常需要调用C++DLL,当传递参数时时常遇到问题,尤其是传递和返回字符串是,现总结一下,分享给大家: VC++中主要字符串类型为:LPSTR,LPCSTR, LPCTSTR, string, CString, LPCWSTR, LPWSTR等, 但转为C#类型却不完全相同。主要有如下几种转换:将string转为IntPtr:IntPtr System.Ru转载 2010-01-13 15:10:00 · 883 阅读 · 0 评论 -
C# 启动进程 重定向IO 死锁避免
创建一个cmd进程,执行一个ping命令,代码如下 Process process = new Process(); process.StartInfo.FileName = "cmd.exe"; process.StartInfo.UseShellExecute = false; // 是否使用外壳程序原创 2010-05-11 10:05:00 · 6813 阅读 · 0 评论