【发布时间】:2015-12-17 16:56:33
【问题描述】:
我不是开发人员,所以请像我五岁一样解释它。不必详细说明,只需指出一个方向,我将在接下来的 2-4 周空闲时间(希望)尝试完成它。
我们的零售系统在 UniData 数据库上运行,命令包括“listuser”“kill __”等。
我们有一个可以在外部看到的网络服务。
我想制作一个基本的 iOS 应用程序,它可以“列出用户”并查看已连接用户的输出、通读列表并输入用户名,然后通过 Web 服务将“kill ___”命令发送回我们的服务器.
我使用 listuser 命令创建了一个批处理文件,然后编写了一些将输出传递到 XML 文档的 C# 代码,我只想能够触发它并从我的 iOS 应用程序加载 XML。
public XmlDocument ListUnidataUser(string VisibleStores)
{
Process p = new Process();
// Redirect the output stream of the child process.
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = @"\\server\c$\ud\listuser.bat";
p.Start();
// Do not wait for the child process to exit before
// reading to the end of its redirected stream.
// p.WaitForExit();
// Read the output stream first and then wait.
string output = p.StandardOutput.ReadToEnd();
XmlDocument xml = new XmlDocument();
xml.LoadXml(output);
p.WaitForExit();
return xml;
}
在这之后,我不知道自己在做什么。这进入我们的 Web 服务,它可以看到这些本地服务器,然后 Web 服务保存该 XML。如何从外部应用建立连接?
如果它更容易学习,我不介意首先尝试制作可以在外部运行的 C# 代码来获取它,并使用 Xamarin 之类的服务为 iOS 编译它,但我很好奇自己的方式Xcode 周围也是如此。
请不要激怒我,我可以听到吉米在我的编码方法中沙沙作响。
【问题讨论】:
标签: c# ios xml web-services