【问题标题】:Unable to find the specified file when publishing application发布应用时找不到指定文件
【发布时间】:2013-11-27 00:22:30
【问题描述】:

我有一个播放 mp3 的 vb.net 应用程序,但是一旦我发布它,就找不到该文件。我收到以下错误

System.IO.FileNotFoundException: 找不到指定的文件。

Public Class Form2
Public audio As New AudioFile(My.Application.Info.DirectoryPath & "\01 - Help.mp3")
Public Sub startsong(ByVal D As Data)
    Me.Show()
    MHTvalue.Text = D.mht.ToString
    Maxcallsvalue.Text = D.maxcalls
    CPHvalue.Text = D.cph
    If Form1.playsong = True Then
        audio.Play()
    End If

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    ' Me.Close()
    audio.Stop()
    Form1.waittimer = 180000
End Sub

End Class 

有什么想法吗?

【问题讨论】:

  • 您将文件存储在哪里?你在解决方案中有它并将其复制到输出吗?

标签: vb.net mp3 publish ioexception


【解决方案1】:

我是个白痴。

我没有在 mp3 文件的构建操作中设置为内容

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-26
    相关资源
    最近更新 更多