Advertisement
6_2008-2009 System Services/ Functions #202307

SystemTray Tutorial

This code demonstrates how to use system tray icons. Currently only works with MFC based apps. Look at the source, if you find any bugs, or have any comments, I will try to fix the problem as soon as I can.

AI

AI-sammanfattning: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Källkod
original-source
Upload
public static Random AppRandom = new Random((int)DateTime.Now.Ticks);
public static string RandomString(int length, bool nums) {
	const string abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
		+ "abcdefghijklmnopqrstuvwxyz";
	const string abc123 = abc + "0123456789";
	string charlist;
	if (nums) {
		charlist = abc123;
	} else {
		charlist = abc;
	}
	System.Text.StringBuilder sb = new System.Text.StringBuilder();
	for (int i=0;i<length;i++) {
		int r = AppRandom.Next(0, charlist.Length);
		sb.Append(charlist.Substring(r, 1));
	}
	return sb.ToString();
}
Originalkommentarer (3)
Återställd från Wayback Machine