文件名和路径都正确啊,在别的机器上运行可以,为什么我的就不可以啊下面是详细信息
未处理 System.IO.IOException
  Message="文件名或编号错误。"
  Source="Microsoft.VisualBasic"
  StackTrace:
       在 Microsoft.VisualBasic.CompilerServices.IOUtils.FindFirstFile(Assembly assem, String PathName, FileAttributes Attributes)
       在 Microsoft.VisualBasic.FileSystem.Dir(String PathName, FileAttribute Attributes)
       在 信封打印.FormTXL.FormTXL_Load(Object sender, EventArgs e) 位置 F:\tf\vblx\信封打印\信封打印\FormTXL.vb:行号 71
       在 System.EventHandler.Invoke(Object sender, EventArgs e)
       在 System.Windows.Forms.Form.OnLoad(EventArgs e)
       在 System.Windows.Forms.Form.SetVisibleCore(Boolean value)
       在 System.Windows.Forms.Control.set_Visible(Boolean value)
       在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       在 System.Windows.Forms.Application.Run(ApplicationContext context)
       在 Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       在 Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       在 Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       在 信封打印.My.MyApplication.Main(String[] Args) 位置 17d14f5c-a337-4978-8281-53493378c1071.vb:行号 81
       在 System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
       在 System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
       在 System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
       在 System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
       在 System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
       在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
       在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       在 System.Threading.ThreadHelper.ThreadStart()

解决方案 »

  1.   

    你这是.Net代码,放到.Net社区会找到答案的。
      

  2.   

    Visual Basic 参考:错误消息 
    错误的文件名或文件号 试图访问指定文件时发生错误。该错误可能的原因包括:  某个语句所引用的文件的文件名或编号未在 FileOpen 语句中指定,或在 FileOpen 语句中指定,但随后被关闭。 某个语句所引用的文件的编号超出了文件编号范围。 某个语句所引用的文件的文件名或编号无效。 更正此错误 
    确保在 FileOpen 语句中指定了该文件名。请注意,如果调用 FileClose 语句时不使用参数,可能会意外地关闭所有打开的文件。 如果代码以算法形式生成文件编号,则确保编号有效。 检查文件名,确保它们符合操作系统约定。 请参见 
    参考 
    FileOpen 函数 概念 
    Visual Basic 命名约定 
      

  3.   

    Visual Basic 参考:错误消息 
    错误的文件名或文件号 试图访问指定文件时发生错误。该错误可能的原因包括:  某个语句所引用的文件的文件名或编号未在 FileOpen 语句中指定,或在 FileOpen 语句中指定,但随后被关闭。 某个语句所引用的文件的编号超出了文件编号范围。 某个语句所引用的文件的文件名或编号无效。 更正此错误 
    确保在 FileOpen 语句中指定了该文件名。请注意,如果调用 FileClose 语句时不使用参数,可能会意外地关闭所有打开的文件。 如果代码以算法形式生成文件编号,则确保编号有效。 检查文件名,确保它们符合操作系统约定。 请参见 
    参考 
    FileOpen 函数 概念 
    Visual Basic 命名约定