如何使用c#复制和保存音频文件?

ank*_*ush 0 c#

我想使用c#复制并粘贴音频文件?

    Int32 intAudioSize = 0;
    string strAudioType = null;
    Stream AudioStream = null;

    // Gets the Size of the Audio
    intAudioSize = FileUpload1.PostedFile.ContentLength;

    // Gets the Audio Type
    strAudioType = FileUpload1.PostedFile.ContentType;

    // Reads the Audio
    AudioStream = FileUpload1.PostedFile.InputStream;
Run Code Online (Sandbox Code Playgroud)

rah*_*hul 5

您可以使用File.Copy方法.

请参阅复制,删除和移动文件和文件夹

编辑

编辑问题.

您可以使用HttpPostedFile.SaveAs方法

用于保存使用该<input type="file" />控件选择的文件