EarthLiveSharp 是一个很有趣的项目。可以将你的桌面壁纸设置为实时的地球卫星图。
通过写入注册表实现开机自启:
using Microsoft.Win32;
public static class Autostart
{
private const string Key = "EarthLiveSharp";
public static bool Set(bool enabled)
{
RegistryKey runKey = null;
try
{
runKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
if (enabled)
{
runKey?.SetValue(Key, Application.ExecutablePath);
}
else
{
runKey?.DeleteValue(Key, false);
}
return true;
}
catch (Exception e)
{
Trace.WriteLine(e.Message);
return false;
}
finally
{
runKey?.Close();
}
}
}