我正在使用这些参数从vb.net安排任务。正确生成任务并执行它。这在本地正常工作,但我需要在服务器上创建该任务。有什么想法吗?
Using tService As New TaskService()
Dim Fecha As DateTime = DateTime.Parse(txtFDesde.Text + " " + txtHDesde.Text)
Dim tTime As New TimeTrigger()
Dim tDefinition As TaskDefinition = tService.NewTask
tDefinition.RegistrationInfo.Description = "Tarea programada para ejecutar"
tDefinition.Settings.RunOnlyIfLoggedOn = False
tTime.StartBoundary = New DateTime(Fecha.Year, Fecha.Month, Fecha.Day, Fecha.Hour, Fecha.Minute, 0)
tDefinition.Triggers.Add(tTime)
Dim url As String = "http://localhost:5000/" & Param
tDefinition.Actions.Add(New ExecAction("cmd.exe", "/c start " & url))
tService.RootFolder.RegisterTaskDefinition("Test " & Param, tDefinition)
End Using
答案 0 :(得分:1)
尝试静态连接方法......您需要服务器凭据.... https://msdn.microsoft.com/en-us/library/windows/desktop/aa383451(v=vs.85).aspx
答案 1 :(得分:0)
这是有效的,我只需要在" Connect()"
上添加服务器参数 var path = directoryPath
path.append("/\(name)")
return FileManager.default.createFile(atPath: path, contents: UIImageJPEGRepresentation(image, 1.0), attributes: nil)
}
/// fetch a image from document directory