以下是引用andyd在2018/8/7 9:56:00的发言:
不想用ftp,服务器还得开ftp服务,如果用网络共享的方式呢?
共享方式的权限比较麻烦,但如果只是【不能删除】的话,你可以直接设置共享文件夹的权限不能删除,即可。
登陆共享文件夹的方式,参考
Dim p As new Process()
p.StartInfo.FileName = "cmd.exe"
p.StartInfo.UseShellExecute = False '关闭Shell的使用
p.StartInfo.RedirectStandardInput = True '重定向标准输入
p.StartInfo.RedirectStandardOutput = True '重定向标准输出
p.StartInfo.RedirectStandardError = True '重定向错误输出
p.StartInfo.CreateNoWindow = True '设置不显示窗口
p.Start()
p.StandardInput.WriteLine( "net use * /del /y")
p.StandardInput.WriteLine( "net use \\192.168.1.240 2014 /user:administrator")
p.StandardInput.WriteLine("exit")