小編給大家分享一下VB.NET如何復制讀取音頻文件到剪貼板,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
成都創(chuàng)新互聯(lián)公司是一家集網(wǎng)站建設,禹王臺企業(yè)網(wǎng)站建設,禹王臺品牌網(wǎng)站建設,網(wǎng)站定制,禹王臺網(wǎng)站建設報價,網(wǎng)絡營銷,網(wǎng)絡優(yōu)化,禹王臺網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強企業(yè)競爭力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時我們時刻保持專業(yè)、時尚、前沿,時刻以成就客戶成長自我,堅持不斷學習、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實用型網(wǎng)站。
示例代碼
Public Class Form1 'VB.Net復制讀取音頻文件并復制到剪貼板 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try Dim MyData As Byte() MyMyData = My.Computer.FileSystem.ReadAllBytes("WindowsXP.wav") My.Computer.Clipboard.SetAudio(MyData) MessageBox.Show("已經(jīng)成功將音頻數(shù)據(jù)VB.Net復制到剪貼板!", "51cto提示", MessageBoxButtons.OK, MessageBoxIcon.Information) Catch ex As Exception MessageBox.Show("將音頻數(shù)據(jù)復制到剪貼板出現(xiàn)錯誤,請檢查音頻文件是否已經(jīng)存在?", "51cto提示", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub '粘貼剪貼板音頻數(shù)據(jù)并播放 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Try Dim MyData As Object MyMyData = My.Computer.Clipboard.GetData(DataFormats.WaveAudio) My.Computer.Audio.Play(MyData, AudioPlayMode.Background) Catch ex As Exception MessageBox.Show("剪貼板上不存在指定的音頻數(shù)據(jù)!", "51cto提示", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub '清空剪貼板上的音頻數(shù)據(jù) Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click My.Computer.Clipboard.Clear() End Sub End Class
看完了這篇文章,相信你對“VB.NET如何復制讀取音頻文件到剪貼板”有了一定的了解,如果想了解更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!