那位大虾帮忙译成 C#代码

netems 2004-12-08 12:29:55
//功能:初次使用时,在文件末部加入某个字符.
DWORD num;
UpdateData(1);
num=m_jms;
num^=0x1999aa98;
if(num==m_gkh)
MessageBox("ok");
CFile ff;
if(!ff.Open("play.exe",CFile::modeWrite))
return;
CString str;
str.Format("%10d",m_jms);
MessageBox(str);
ff.SeekToEnd();
ff.Write(str,10);//添加到play.exe尾部
ff.Close();
...全文
63 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
hanbingture 2004-12-08
  • 打赏
  • 举报
回复
using System;
using System.IO;
using System.Windows.Forms;

....
....
long num;
num=m_jms;
num^=0x1999aa98;
if(num==m_gkh)
MessageBox.Show("ok");
string str=m_jms.ToString("D");
MessageBox.Show(str);

try
{
string path = @"c:\play.exe";
if(File.Exists(path))
{
using (StreamWriter sw = File.AppendText(path))
{
sw.Write(str);
}
}
else
MessageBox.Show("No this File");

}
catch(Exception e)
{
MessageBox.Show("Error:"+e.Message);
}
.......
.......

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧