Ultimate Keylogger - Global KeyBoard Hook [C# Tutorial]
GlobalKeyboardHook
https://docs.google.com/document/d/1jEovZJo-0sz8snF5ZcvJmfqrdjkVYrhEWWvvn6kpggM/edit?usp=sharing
https://www.mediafire.com/file/1777b9cwl4rh5hf/GlobalKeyBoardHook.cs
using System;
//宣告一個委派型別為ConvertMethod,
//並規範入為string型別,輸出為string型別
delegate string ConvertMethod(string inString);
public class DelegateExample
{
public static void Main()
{
// Instantiate delegate to reference UppercaseString method
// 將委派型別ConvertMethod的實體去參考UppercaseString方法
ConvertMethod aConvertMeth = UppercaseString;
string name = "Dakota";
// Use delegate instance to call UppercaseString method
Console.WriteLine(aConvertMeth(name));
}
private static string UppercaseString(string inputString)
{
return inputString.ToUpper();
}
}
using System;
public class GenericFunc
{
public static void Main()
{
// Instantiate delegate to reference UppercaseString method
//Func<in T, out TResult>
Func<string, string> aConvertMethod = UppercaseString;
string name = "Dakota";
// Use delegate instance to call UppercaseString method
Console.WriteLine(aConvertMethod(name));
Console.ReadKey();
}
private static string UppercaseString(string inputString)
{
return inputString.ToUpper();
}
}
using System; public class Anonymous { public static void Main() { Func<string, string> convert = delegate(string s){ return s.ToUpper();}; string name = "Dakota"; Console.WriteLine(convert(name)); } }
using System; public class Anonymous { public static void Main() { Func<string, string> convert = s => s.ToUpper(); string name = "Dakota"; Console.WriteLine(convert(name)); } }
using System;
public class GenericFunc
{
public static void Main()
{
Action<string> aConvertMethod = UppercaseString;
string name = "Dakota";
aConvertMethod(name);
Console.ReadKey();
}
private static void UppercaseString(string inputString)
{
Console.WriteLine(inputString.ToUpper());
}
}