[英]How to programmatically save files (.csv) from local machine running c# application to virtual machine
Hey guys so I have this one c# application which outputs these .csv's and I want it to send it to a virtual machine which has a python application that will pick up these files and do some data analysis on it. 大家好,我有一个输出这些.csv的c#应用程序,我希望它将其发送到具有python应用程序的虚拟机,该应用程序将提取这些文件并对其进行一些数据分析。 Is there any way to create a connection between the c# application and the virtual machine so that I can save the .csvs in the virtual machine directory for pickup by the python script. 有什么方法可以在c#应用程序和虚拟机之间创建连接,以便我可以将.csvs保存在虚拟机目录中,以供python脚本提取。
As an option, you could create a Dropbox (or similar service) account, point your C# app to write the CSVs to this folder, and then access Dropbox from the VM for your Python app to pickup said CSVs. 作为一种选择,您可以创建一个Dropbox(或类似服务)帐户,将您的C#应用程序指向将CSV写入此文件夹,然后从VM中为您的Python应用程序访问Dropbox来提取所述CSV。
You could also create a share on the VM, map it on the host (as long as you are on the same subnet, the VM has its own IP and is not bridged on the physical host's IP), have the C# app write the CSVs to this share, then point your Python app to parse the CSVs from the network share within the VM. 您还可以在VM上创建共享,将其映射到主机上(只要您在同一子网中,VM就有自己的IP,并且不桥接在物理主机的IP上),让C#应用编写CSV到此共享,然后指向您的Python应用程序以从VM中的网络共享中解析CSV。
In Addition: 此外:
System.IO.File.Copy("sourcePath", "\\machinename\share folder path");
HTHs! HTHS!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.