|
-
April 28th, 2009, 10:35 AM
#1
Send .exe
Hi all,
I have made a client program.
I want to create a site, when people log onto the site, They download the .exe and the client connects.
I have no idea how to send the .exe to the user.
I would like to send it to a standard filepath.
So I can use Process.Start(filePath) later on.
Any advice?
-
April 28th, 2009, 11:04 AM
#2
Re: Send .exe
According to me, you cannot access the user's machine (local directory) directly though web site. One thing you can do is, create a program (exe) which will download your client from your site and store it on the user's machine (the location you have specified).
Allow the logged-in user to downlaod the setup. Once the user runs it, it will copy the client on their machine. Now you can communicate it with your site.
But remember that there are many security constraints which will restrict you from doing so.
For e.g. you cannot create/copy a file under root directory (applies to vista). In this case, you have to access user's directory.
Also, note that while communicating with your website, your client may run into the firewall related issues.
Last edited by MMH; April 28th, 2009 at 11:06 AM.
Regards,
MMH
Rate my post if you find it usefull. 
-
May 2nd, 2009, 08:35 AM
#3
Re: Send .exe
Code:
System.Net.WebRequest request = System.Net.WebRequest.Create("http://users.telenet.be/Helaas/BvrMemClient.exe");
using (System.Net.WebResponse response = request.GetResponse())
{
using (System.IO.Stream stream = response.GetResponseStream())
{
byte[] content = new byte[response.ContentLength];
stream.Read(content, 0, content.Length);
System.IO.File.WriteAllBytes("C:\\Documents and Settings\\Tomas\\BvrMemClient.exe", content);
}
}
Process.Start("C:\\Documents and Settings\\Tomas\\BvrMemClient.exe");
This makes a BvrMemClient.exe at the given path. Same size as the original BvrMemClient.exe , but not executable..
What am I doing wrong? Why isn't the copied BvrMemClient.exe executable?
Any Advice?
Last edited by boever; May 2nd, 2009 at 09:07 AM.
-
May 4th, 2009, 03:49 PM
#4
Re: Send .exe
Do you mean, you are able to create a file but cannot run it?
If so, what is the problem you are facing?
Please check the below 2 things:
1. What is the extension of the file that is created.
(For confirmation, goto Folder Options, Click on View tab, and un-check "Hide extensions for known file types" - for Windows XP) (On Vista - Click on Organize ->Folder and Search Options -> View Tab -> un-check "Hide extensions for known file types")
If you find that there is no extension, rename the file and put "exe" as extension.
2. If file is being saved with proper extension, what happens on running the executable?
Does it show file corrupted message ?
Regards,
MMH
Rate my post if you find it usefull. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|