简体   繁体   English

将视频文件保存在特定文件夹中:Windows Form Application C#

[英]Saving video file in a Specific Folder : Windows Form Application C#

Hey guys uhm well as you can see i'm having trouble saving a video file because some answers in some threads here doesn't suggest that a video file should be saved in a database because it will only prolong the process, so the point here is that i'm trying to save a video file from a specific folder. 大家好,您可以看到我在保存视频文件时遇到了麻烦,因为此处某些线程中的某些答案并不表明应该将视频文件保存在数据库中,因为这只会延长过程,所以这里的重点是我正在尝试从特定文件夹保存视频文件。 im not that used to "savefiledialog" function yet but i'm doing reseaches about it, 即时消息不是以前用来“ savefiledialog”功能的消息,但是我正在研究它,

i just need to know if it is possible to create the same video file and save it as a new copy with a different name using savefiledialog. 我只需要知道是否可以创建相同的视频文件,并使用savefiledialog将其另存为新的副本。

Here's the sample of my form pre 这是我表格的样本

thanks for your response guys if there's one 感谢您的回复,如果有一个

You can use System.IO.File.Copy to copy file from a source to destination. 您可以使用System.IO.File.Copy将文件从源复制到目标。 For example: 例如:

var sourceFile=@"d:\video.avi";
var saveFileDialog = new SaveFileDialog();
//You can offer a default name
saveFileDialog.FileName = "video-copy.avi";
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
    System.IO.File.Copy(sourceFile, saveFileDialog.FileName);
}

If destination file exists, you will receive an exception. 如果目标文件存在,您将收到一个例外。 You can check for file existence using System.IO.File.Exists or you can overwrite the destination file using System.IO.File.Copy(source, destination, true) . 您可以使用System.IO.File.Exists检查文件是否存在,也可以使用System.IO.File.Copy(source, destination, true)覆盖目标文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将文件保存到 Windows Form C# 中的特定文件夹 - Save file to a specific folder in Windows Form C# C#-Windows窗体应用程序-保存文件 - C# - windows form applications - saving a file 使用Windows窗体和C#将Excel文件保存在应用程序文件夹中并将内容上传到SQL Server - Saving excel file in application folder and uploading the content to SQL Server using windows forms and C# C#:如何使用 Google Drive API v3 将文件上传到特定文件夹 - Windows 控制台应用程序 - C# : How to Upload File to a Specific Folder using Google Drive API v3 - Windows Console Application 如何使用C#将.bak文件保存在特定文件夹中(Windows应用程序) - How to save .bak file in specific folder using C# (windows application) 从 C# windows 窗体应用程序中的资源文件夹中检索图像 - Retrieving Images from Resource folder in C# windows form application 将窗体列表框保存到文本文件C# - Saving windows form listbox to a text file C# 创建文件后从Windows窗体保存C# - C# Saving from a Windows form after Creating the File Windows窗体C#中的文件夹 - Folder in windows form c# 尝试在Windows窗体应用程序C#中更改字符串的特定字符 - Trying to change specific characters of a string in a Windows Form Application, C#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM