좋아, 그래서 주위를 둘러 봤는데 어디서나 답을 찾을 수 없다.작업 관리자에서 프로그램 프로세스 이름을 변경 하시겠습니까?
내 프로그램을 실행할 때마다 작업 관리자에 표시되는 이름이 무작위로 선택됩니다.
'Liberation'이라는 프로그램이 있는데,이 프로그램을 실행하면 프로세스 이름이 AeB4B3wf52.tmp 또는 임의의 임의의 문자로 변경됩니다. 나는 그것이 무엇이 코딩되어 있는지 확신하지 못하기 때문에 문제가 될 수있다.
C#에서 가능합니까?
편집 : 나는 'pb.dat'라는 파일이 있는지 확인하는 별도의 프로그램을 만들어 임시 폴더에 복사하고 '임의 문자'로 이름을 바꿉니다. tmp '를 실행하십시오. 사람이 관심이 있다면
코드 :
private void Form1_Load(object sender, EventArgs e)
{
try
{
if (!Directory.Exists(Environment.CurrentDirectory + @"\temp")) // Create a temp directory.
Directory.CreateDirectory(Environment.CurrentDirectory + @"\temp");
DirectoryInfo di = new DirectoryInfo(Environment.CurrentDirectory + @"\temp");
foreach (FileInfo f in di.GetFiles()) // Cleaning old .tmp files
{
if (f.Name.EndsWith(".tmp"))
f.Delete();
}
string charList = "abcdefghijklmnopqrstuvwxyz1234567890";
char[] trueList = charList.ToCharArray();
string newProcName = "";
for (int i = 0; i < 8; i++) // Build the random name
newProcName += trueList[r.Next(0, charList.Length)];
newProcName += ".tmp";
if (File.Exists(Environment.CurrentDirectory + @"\pb.dat")) // Just renaming and running.
{
File.Copy(Environment.CurrentDirectory + @"\pb.dat", Environment.CurrentDirectory + @"\temp\" + newProcName);
ProcessStartInfo p = new ProcessStartInfo();
p.FileName = Environment.CurrentDirectory + @"\temp\" + newProcName;
p.UseShellExecute = false;
Process.Start(p);
}
}
catch (Exception ex)
{
MessageBox.Show("I caught an exception! This is a bad thing...\n\n" + ex.ToString(), "Exception caught!");
}
Environment.Exit(-1); // Close this program anyway.
}
는 소리는 바이러스를 작성하는 것처럼 :) – Andrew
앤드류를 : 롤, 일을! 어쨌든, 이것은 인터넷에서 발견됩니다! http://stackoverflow.com/questions/1055987/c-how-to-set-an-projects-executable-processname – dqm
이것은 일종의 학교 프로젝트이며, 특정 프로세스를 닫는 프로세스 차단기를 작성하고 있습니다. 선생님은 하하라는 이름을 무작위로 만들 것을 제안했습니다. – Tim