在网络文件夹中保存pictureBox图像

时间:2021-10-19 00:24:52

i want to save picturebox image in a share folder on network i use this code pictureBox1.Image.Save(@"192.168.1.39\xxxxxx", System.Drawing.Imaging.ImageFormat.Jpeg);

我想将图片框图像保存在网络上的共享文件夹中我使用此代码pictureBox1.Image.Save(@“192.168.1.39 \ xxxxxx”,System.Drawing.Imaging.ImageFormat.Jpeg);

but it rauses error please help me!

但它出现错误请帮助我!

xxxxxx is name of shahre folder

xxxxxx是shahre文件夹的名称

2 个解决方案

#1


0  

A literal reading of your question ("xxxxxx is name of share folder") suggests that you're making a call like:

您的问题的字面读数(“xxxxxx是共享文件夹的名称”)表明您正在拨打电话,如:

pictureBox1.Image.Save(@"192.168.1.39\myshare",
                         System.Drawing.Imaging.ImageFormat.Jpeg);

You'll need to specify the name of the file you want to create:

您需要指定要创建的文件的名称:

pictureBox1.Image.Save(@"192.168.1.39\myshare\myfile.jpg",
                         System.Drawing.Imaging.ImageFormat.Jpeg);

#2


0  

As far as I know, you can't use the IP of machine in order to access its disk. Try mapping the network folder as local drive on your machine, e.g. Z: and then:

据我所知,你不能使用机器的IP来访问它的磁盘。尝试将网络文件夹映射为计算机上的本地驱动器,例如Z:然后:

pictureBox1.Image.Save(@"Z:\xxxxxx", System.Drawing.Imaging.ImageFormat.Jpeg);

#1


0  

A literal reading of your question ("xxxxxx is name of share folder") suggests that you're making a call like:

您的问题的字面读数(“xxxxxx是共享文件夹的名称”)表明您正在拨打电话,如:

pictureBox1.Image.Save(@"192.168.1.39\myshare",
                         System.Drawing.Imaging.ImageFormat.Jpeg);

You'll need to specify the name of the file you want to create:

您需要指定要创建的文件的名称:

pictureBox1.Image.Save(@"192.168.1.39\myshare\myfile.jpg",
                         System.Drawing.Imaging.ImageFormat.Jpeg);

#2


0  

As far as I know, you can't use the IP of machine in order to access its disk. Try mapping the network folder as local drive on your machine, e.g. Z: and then:

据我所知,你不能使用机器的IP来访问它的磁盘。尝试将网络文件夹映射为计算机上的本地驱动器,例如Z:然后:

pictureBox1.Image.Save(@"Z:\xxxxxx", System.Drawing.Imaging.ImageFormat.Jpeg);