DALFactory.MultiMs.bulidSmil(Application.StartupPath + @"\" + FL + "\\", fName + ".smil", alimge, altxt, alsound, alTime);
                string mmsInfo = DALFactory.MultiMs.readfilekb(Application.StartupPath + @"\" + FL);
                label16.Text = "您制作的彩信大小为" + mmsInfo.ToString() + ";彩信不能超过" + intSupportKB.ToString() + "kb!";
//没什么运行到label16.Text...这个位置就会报出异常提示“尝试读取或写入受保护的内存”,并且在这句的前面如果执行一次MessageBox.show("1");  异常就不会出现
                string SubSize = mmsInfo.Substring(0, mmsInfo.Length - 2);
                MMSsize = Convert.ToDecimal(SubSize);针对上述问题,请教各位,在下新人!谢谢winform

解决方案 »

  1.   

    你用多线程了吧?
    如果在读数据的时候用了多线程。你那时候还没取出值来。
    sleep一下就好了
      

  2.   


    错误标题:内部上传方法异常错误信息:尝试读取或写入受保护的内存。这通常指示其他内存已损坏。错误内容:   在 System.Windows.Forms.SafeNativeMethods.SetWindowPos(HandleRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)
       在 System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
       在 System.Windows.Forms.Label.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
       在 System.Windows.Forms.Control.SetBounds(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
       在 System.Windows.Forms.Control.set_Size(Size value)
       在 System.Windows.Forms.Label.AdjustSize()
       在 System.Windows.Forms.Label.OnTextChanged(EventArgs e)
       在 System.Windows.Forms.Control.set_Text(String value)
       在 System.Windows.Forms.Label.set_Text(String value)
       在 JXT.WinForm.MultiMs.UpdateMMS() 位置 D:\2.0.0.12\JXT\WinForm\MultiMs.cs:行号 730