is it possible to replicate this using cmd in c#
is it possible to replicate this using cmd in c#
Yes, if you're just talking about pushing content up to a site, I'm working on such a beast now.
My proof-of-concept used a Process
object to simply run a cmd.exe
script that used FTP:
using System.Diagnostics;
:
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.FileName = "myUpload.cmd";
p.Start();
p.WaitForExit();
The program published the web site (it wasn't an actual web site but similar enough that the same method can be used) locally and used the browser to open the file (this was static content only so no need for a web server).
Then, once validated by the user, it simply created a script file temp.ftp
containing all the relevant commands and used ftp -s:temp.ftp -n test.com
within myUpload.cmd
to do the file transfer. The -s
specifies the script to run and the -n
stops automatic login. That's so you can dynamically create a user
command in your script to log in.
The final version will actually probably run Python code so I don't have to fight the brain-deadedness of cmd.exe
but the theory is the same.