I try to build an application using a builder and a stub but i fail
My builder code :
File.Copy(AppDomain.CurrentDomain.BaseDirectory + @"\Camstub.exe", filepath);
string split = "|";
string info = split + CName.Text + split + Link.Text + split;
FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.ReadWrite, FileShare.None);
BinaryWriter bw = new BinaryWriter(fs);
fs.Position = fs.Length + 1;
bw.Write(info);
bw.Close();
MessageBox.Show(info);
My stub code :
public MainWindow()
{
InitializeComponent();
StreamReader sr = new StreamReader(System.Windows.Forms.Application.ExecutablePath);
BinaryReader br = new BinaryReader(sr.BaseStream);
byte[] fileData = br.ReadBytes(Convert.ToInt32(sr.BaseStream.Length));
br.Close();
sr.Close();
ASCIIEncoding Enc = new ASCIIEncoding();
string split = "|";
string Message = Enc.GetString(fileData);
MessageBox.Show(Message);
The messagebox in the builder show me:
The application is sucessfully build but the messagebox when i execute it show me:
So, I expect the same messagebox in both.
Any idea ?
Thanks in advance ;)