首页 > 解决方案 > 屏幕共享错误 - 当文件已存在时无法创建文件

问题描述

我正在使用下面的代码来共享屏幕。

namespace host
{
    public partial class Form1 : Form
    {
        RDPSession x = new RDPSession();
       
        private void button1_Click(object sender, EventArgs e)
        {
            x.OnAttendeeConnected += Incoming;
            x.Open();
        }
               
    }
}

在 Windows 7 pc 中,我将在屏幕共享上随机收到以下代码行 RDPSession x = new RDPSession() 错误。

错误:

Creating an instance of the COM component with CLSID {9B78F0E6-3E05-4A5B-B2E8-E743A8956B65} from the IClassFactory failed due to the following error: 800700b7 Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7).

原因是什么以及如何解决此错误?

标签: c#

解决方案


完成 RDPSession 后,使用“Disconnect()”函数关闭连接。看看这是否可以为您解决问题。


推荐阅读