zoukankan      html  css  js  c++  java
  • 在Win7下要通过某个 线程 来调用SavaDialog文件选择框的问题

    如果 在Win7下要通过某个 线程 来调用SavaDialog文件选择框的代码  选择窗口 有时会出不来 需要设置如下:
        ThreadthreadOfRec = new Thread(ReciveMsg);
                    threadOfRec.SetApartmentState(ApartmentState.STA);
                    threadOfRec.IsBackground = true;
                    threadOfRec.Start();


      SaveFileDialog sfd = new SaveFileDialog();
                            if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                            {
                                using (FileStream fs = new FileStream(sfd.FileName, FileMode.OpenOrCreate))
                                {
                                    fs.Write(msgRecived, 1, length - 1);
                                    MessageBox.Show("文件写入成功!!!");
                                }
                            }

  • 相关阅读:
    TableViewCell bug
    iOS系统框架概述
    Cocoapods的安装与使用
    ios开发学习路径
    django第七天总结
    django第六天上课总结
    django第四天
    django第四天上课总结
    django第三天 小记
    django第三天
  • 原文地址:https://www.cnblogs.com/haofaner/p/4005314.html
Copyright © 2011-2022 走看看