C# copydataÏûÏ¢´¦Àí
http://blog.csdn.net/carl2380/archive/2009/11/18/4826973.aspx
¼ò½é:
±¾ÎÄ×ÅÖؽ²ÊöÁËÈç¹ûÓÃWM_COPYDATAÏûÏ¢À´ÊµÏÖÁ½¸ö½ø³ÌÖ®¼ä´«µÝÊý¾Ý.
½ø³ÌÖ®¼äͨѶµÄ¼¸ÖÖ·½·¨:
ÔÚWindows³ÌÐòÖУ¬¸÷¸ö½ø³ÌÖ®¼ä³£³£ÐèÒª½»»»Êý¾Ý£¬½øÐÐÊý¾ÝͨѶ¡£³£Óõķ½·¨ÓÐ
ʹÓÃÄÚ´æÓ³ÉäÎļþ
ͨ¹ý¹²ÏíÄÚ´æDLL¹²ÏíÄÚ´æ
ʹÓÃSendMessageÏòÁíÒ»½ø³Ì·¢ËÍWM_COPYDATAÏûÏ¢
±ÈÆðÇ°Á½Öֵĸ´ÔÓʵÏÖÀ´,WM_COPYDATAÏûÏ¢ÎÞÒÉÊÇÒ»ÖÖ¾¼Ãʵ»ÝµÄÒ»Öз½·¨.
WM_COPYDATAÏûÏ¢µÄÖ÷ҪĿµÄÊÇÔÊÐíÔÚ½ø³Ì¼ä´«µÝÖ»¶ÁÊý¾Ý¡£WindowsÔÚͨ¹ýWM_COPYDATAÏûÏ¢´«µÝÆڼ䣬²»Ìṩ¼Ì³Ðͬ²½·½Ê½¡£SDKÎĵµÍƼöÓû§Ê¹ÓÃSendMessageº¯Êý£¬½ÓÊÜ·½ÔÚÊý¾Ý¿½±´Íê³ÉÇ°²»·µ»Ø£¬ÕâÑù·¢ËÍ·½¾Í²»¿ÉÄÜɾ³ýºÍÐÞ¸ÄÊý¾Ý£º
Õâ¸öº¯ÊýµÄÔÐͼ°ÆäÒªÓõ½µÄ½á¹¹ÈçÏÂ:
SendMessage(hwnd,WM_COPYDATA,wParam,lParam);
ÆäÖÐ,WM_COPYDATA¶ÔÓ¦µÄÊ®Áù½øÖÆÊýΪ0x004A
wParamÉèÖÃΪ°üº¬Êý¾ÝµÄ´°¿ÚµÄ¾ä±ú¡£lParamÖ¸ÏòÒ»¸öCOPYDATASTRUCTµÄ½á¹¹£º
typedef struct tagCOPYDATASTRUCT{
DWORD dwData;//Óû§¶¨ÒåÊý¾Ý
DWORD cbData;//Êý¾Ý´óС
PVOID lpData;//Ö¸ÏòÊý¾ÝµÄÖ¸Õë
}COPYDATASTRUCT;
¸Ã½á¹¹ÓÃÀ´¶¨ÒåÓû§Êý¾Ý¡£
¾ßÌå¹ý³ÌÈçÏÂ:
Ê×ÏÈ,ÔÚ·¢ËÍ·½,ÓÃFindWindowÕÒµ½½ÓÊÜ·½µÄ¾ä±ú,È»ºóÏò½ÓÊÜ·½·¢ËÍWM_COPYDATAÏûÏ¢.
½ÓÊÜ·½ÔÚDefWndProcʼþÖÐ,À´´¦ÀíÕâÌõÏûÏ¢.ÓÉÓÚÖÐÎıàÂëÊÇÁ½¸ö×Ö½Ú,ËùÒÔ´«µÝÖÐÎÄʱºò×Ö½Ú³¤¶ÈÒª¸ãÇå³þ.
´úÂëÖÐÓÐÊÊÁ¿µÄ½âÊÍ,´ó¼ÒÇë×Ô¼º¿´°É.
¾ßÌå´úÂëÈçÏÂ:
//---------------------------------------------------
//·¢ËÍ·½:
//---------------------------------------------------
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Runtime.InteropServices;
namespace WindowsFormGetMsg
{
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox textBox1;
private System.ComponentModel.Container components = null;
const int WM_COPYDATA = 0x004A;
public Form1()
{
InitializeComponent();
}
protected override void Di
Ïà¹ØÎĵµ£º
Ò»¡¢Ê×ÏÈÏÈÌí¼ÓÒýÓà using Microsoft.Win32;
//ÒòΪ²Ù×÷×¢²á±íµÄÁ½¸öÀàRegistryKeyºÍRegistry¶¼°üº¬ÔÚ´ËÒýÓÃÖУ»
¶þ¡¢±àд´úÂ뿪ʼ²Ù×÷×¢²á±í
1¡¢ #region ÏÞÖÆÈí¼þµÄʹÓôÎÊý
pri ......
c#ÊÂÎñ»Ø¹ö£¨×ª£©
×÷Õߣºxue5ya À´Ô´£º²©¿ÍÔ° ·¢²¼Ê±¼ä£º2009-03-20 16:08 ÔĶÁ£º263 ´Î ÔÎÄÁ´½Ó [ÊÕ²Ø]
Code
public void UpdateContactTableByDataSet(DataSet ds,string strTblName)
{
......
ÊÖ»úÉÏÍøÔ½À´Ô½ÆÕ¼°£¬ÊÖ»úÖÖÀàÔ½À´Ô½¶à£¬Òª¿ª·¢Ò»¸ö¹©ÊÖ»ú·ÃÎÊÍøÕ¾²¢¼æÈÝËùÓв»Í¬ÀàÐ͵ÄÊÖ»úºÍä¯ÀÀÆ÷ÊǺܲ»ÈÝÒ׵ģ¬±±¾©Ê¦·¶´óѧ×ÔÏ°ÊÒ²éѯƽ̨µÄÊÖ»ú°æ×î³õÊÇÖ±½ÓÓÃASP.NETʵÏֵģ¬Ö»ÊÇÓÃCSS¶¨Òå³ÉÁËÊʺÏÊÖ»úÆÁÄ»µÄÒ³Ã棬ËäȻͬѧÃÇ·ÃÎÊ»ù±¾Ã»ÓÐÎÊÌ⣬µ«ÊÇҲż¶û»áÓГ²»ÄÜÑ¡ÔñÏÂÀ²Ëµ¥”¡¢“°´Å¥button²»Ä ......
C-#ÈëÞµä(µÚÈý°æ).pdf
using System;
using System.Data;
using System.Data.SqlClient;
namespace My_Student
{
static class Program
{
static void Main()
&n ......
Ìá¸ßC#±à³ÌˮƽµÄ50¸öÒªµã
1.×ÜÊÇÓÃÊôÐÔ (Property) À´´úÌæ¿É·ÃÎʵÄÊý¾Ý³ÉÔ±
2.ÔÚ readonly ºÍ const Ö®¼ä£¬ÓÅÏÈʹÓà readonly
3.ÔÚ as ºÍ Ç¿ÖÆÀàÐÍת»»Ö®¼ä£¬ÓÅÏÈʹÓà as ²Ù×÷·û
4.ʹÓÃÌõ¼þÊôÐÔ (Conditional Attributes ......