我有我自己的服务器与本地IP为172.23.1.66在CentOS 7C#保存PictureBox的Image到远程服务器
所以在我的计划,我可以用我的字符串imageLocation =“http://172.23.1.66/img/978979892782.jpg”服务器调用图像;
在其他情况下,我想将它保存到我的远程服务器。我无法在Windows资源管理器中访问它,我只能在浏览器上访问它。我使用WinSCP远程控制它。
我尝试这样的:
picImage.Image.Save(@"\\172.23.1.66\img\" + clsLibrary.throwCode + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg); // throwCode is my file name
但它扔型 'System.Runtime.InteropServices.ExternalException' 未处理的异常发生在System.Drawing.dll程序
我也有请尝试删除第一个IP中的\\。
一切都会失败,任何人都可以帮忙吗?
后写图像到一个临时文件中,然后使用[SFTP]发送它(http://blog.deltacode.be/2012/01/05/uploading-a-file-使用-sftp-in-c-sharp /) – Martheen
你可以编写一个小型的C++或python服务器,你可以从c#程序发送一个图像文件缓冲区,并在接收到它之后,服务器程序会将它保存到你给定的路径 –