简体   繁体   English

如何以编程方式将运行c#应用程序的本地计算机中的文件(.csv)保存到虚拟机

[英]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.

相关问题 如何使用 C# 在 Windows 应用程序中使用 SaveFileDialog 在来自 HttpClient 的本地计算机上保存 Zip 文件? - How to save Zip file on local machine which is coming from HttpClient using SaveFileDialog in Windows application using C#? 保存图片 <notesbitmap> dxl文件中的文件到本地计算机,c# - save image from <notesbitmap> in dxl file to local machine , c# C#将文件从本地计算机复制到远程共享失败 - C# Copying files from local machine to remote share failed 如何从 C# 中的 PowerShell 脚本运行 Azure 虚拟机 - How to run Azure virtual machine from PowerShell script in C# 如何从虚拟机连接 C# 和 MySQL? - How can I connect C# with MySQL from Virtual Machine? 使用C#代码或.net以编程方式在Windows Azure中创建虚拟机 - Create a virtual machine in windows azure programmatically with C# code or .net 如何以编程方式启动虚拟机? - How to start virtual machine programmatically? 如何以编程方式将文件传输到同一网络上的虚拟机? - How to transfer files to a Virtual Machine on the same network programmatically? 如何使用C#从本地计算机商店读取PFX证书 - How to Read PFX Certificate from local machine Store with C# 以编程方式编辑Local_Machine注册表项(C#) - Editing Local_Machine RegistryKeys Programmatically (C#)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM