c#ÀûÓÃwinapi±éÀú×ÀÃæ¿Ø¼þËã·¨
public enum GUIInfoType
{
guiText.
guiTextClass,
guiTextParent,
guiTextClassParent,
}
private static int level=0
public static int FindGUILike(ref int hWndArray,int hWndStart,ref string windowText,ref string className,ref string parentText)
{
int hwnd=0;
int r=0;
StringBuilder sWindowText=new StringBuilder();
StringBuilder sClassname=new StringBuilder();
StringBuilder sParentText=new StringBuilder();
if(level==0)
{
hWndTarget=0;
if(hWndTarget==0) hWndStart = GetDesktopWindow();
}
level=level+1;
hwnd=GetWindow(hWndStart,GW_CHILD);
while(hwnd!=0)
{
r=FindGUILike(ref hWndArray,hwnd windowText,ref classname,ref parentText);
sWindowText.Capacity=255;
r=GetClassName(hwnd,sWindowsText,255);
sClassname.Capacity=255;
r=GetWindowText(GetParent(hwnd),sParentText,225);
GUIInfoType guiInfoType=GetGUIInfoType(windowText,className,parentText);
ResetGUIInfo(guiInfoType,hwnd,ref hWndArray,ref windowText,ref className,ref parentText,sWindowText,sClassname,sParentText);
hwnd=GetWindow(hwnd,GW_HWNDNEXT);
}
level=level-1;
return 0;
}
private static GUIInfoType GetGUIInfoType(string winText,string winClass,string winTextParent)
{
if(winText!=''&&winClass!=''&winTextParent=='')
return GUIInfoType.guiTextClass;
else if(winText!=''&&winClass==''&winTextParent!='')
return GUIInfoType.guiTextParent;
else if(winText!=''&&winClass!=''&winTextParent=='')
return GUIInfoType.guiClassParent;
return GUIInfoType.guiText;
}
private static void ResetGUIInfo(GUIInfoType guiInfoType,int hwnd,ref int hWndTarget,ref string windowText,ref string className,ref string parentText,StringBuilder sParentText)
{
string clsStartedWith='';
if(clas
Ïà¹ØÎĵµ£º
private void Create_Pz(string Sourcename)
{
string OutMsg;
SqlParameter[] sortPara = { new SqlParameter("@ps_IsType", Pz ......
Ò»¡¢»ù±¾ÔÀí¼°¹ý³Ì
Flashͨ¹ýExternalInterfaceÀàÓëÈÝÆ÷Ó¦ÓóÌÐò½øÐÐͨÐÅ¡£Îª´Ë£¬ExternalInterfaceÀàÌṩÁ½¸ö¾²Ì¬ÊôÐÔºÍÁ½¸ö¾²Ì¬·½·¨¡£
ExternalInterface.call(“º¯ÊýÃû”£¬[²ÎÊý…])·½·¨Ö´ÐÐÈÝÆ÷Ó¦ÓóÌÐòµÄ´úÂ룬¸Ã·½·¨ÖÁÉÙÐèÒªÒ»¸ö×Ö·û´®²ÎÊýÀ´Ö¸¶¨Òªµ÷Óõĺ¯ÊýÃû£¬ÆäËüÈκβÎÊý½«×÷Ϊ²ÎÊý±»´«µÝ¸ø± ......
ÒÑÖªÓÐÒ»¸öXMLÎļþ£¨bookstore.xml£©ÈçÏ£º
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="fantasy" ISBN="2-3631-4">
<title>Oberon's Legacy</title>
<author>Corets, Eva</author>
&nb ......
send :
string path = "E:\\c#\\convey_file\\convey_file\\Form1.cs"; //Òª´«ÊäµÄÎļþ
TcpClient client = new TcpClient();
client.Connect(IPAddress.Parse("192.168.0.52"),9999);
FileStream file = new FileStream(path,FileMode.Open,FileAccess.Read); // ......
ÔÚnetÖÐÓÐÒ»¸öÖÁ¹ØÖØÒªµÄ¹Ø¼ü×Ö£¬ÄǾÍÊÇusing
usingÒ»°ãÓÐ×ÅÒÔϼ¸ÖÖÓ÷¨£º
1¡¢Ö±½ÓÒýÈëÃüÃû¿Õ¼ä
a¡¢using System £¬Õâ¸öÊÇ×î³£Óõ쬾ÍÊÇusing+ÃüÃû¿Õ¼ä£¬ÕâÑù¾Í¿ÉÒÔÖ±½ÓʹÓÃÃüÃû¿Õ¼äÖеÄÀàÐÍ£¬¶øÃâÈ¥ÁËʹÓÃÏêϸµÄÃüÃû¿Õ¼ä
b¡¢Ê¹ÓÃÈ«ÏÞ¶¨Ãû
²»ÓÃʹÓÃusing System;Ö±½ÓÔÚ³ÌÐòÖе÷ÓÃSystem.Console.WriteLine("Hello ......