@
dbas public static int IfVerify ()
{
Bitmap a = Piccolor.GetWindow (hwnd );
if (ColorTranslator.ToWin32 (a.GetPixel (347, 219 )) == 16776960 && ColorTranslator.ToWin32 (a.GetPixel (516, 411 )) == 3407871 )
{
int key =ColorTranslator.ToWin32 (a.GetPixel (418, 305 )) +
ColorTranslator.ToWin32 (a.GetPixel (418, 326 )) +
ColorTranslator.ToWin32 (a.GetPixel (529, 305 )) +
ColorTranslator.ToWin32 (a.GetPixel (529, 326 )) +
ColorTranslator.ToWin32 (a.GetPixel (654, 305 )) +
ColorTranslator.ToWin32 (a.GetPixel (654, 326 )) +
ColorTranslator.ToWin32 (a.GetPixel (793, 305 )) +
ColorTranslator.ToWin32 (a.GetPixel (793, 326 ));
if (ConfigManager.hashTable.ContainsKey (key ))
{
a.Dispose ();
switch (ConfigManager.hashTable[key].ToString ())
{
case "1":
Common.Click (418, 305 );
break;
case "2":
Common.Click (529, 305 );
break;
case "3":
Common.Click (654, 305 );
break;
case "4":
Common.Click (793, 305 );
break;
}
return 1;
}
else
{
string path = "C:/" + key + ".jpg";
a.Save (path );
Common.SendFile (path );
a.Dispose ();
return 2;
}
}
a.Dispose ();
return -1;
}
以此段为例:
Dispose.调的满天飞。。
RGB 直接加起来做 key..
hashTable[key]取出来不进行类型转换,直接调了继承自 objcet 的 ToString ()。。。
临时文件直接写到 C 盘根。。
先不说类。。这么干没问题?