惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Exploit Database - CXSecurity.com
A
Arctic Wolf
K
Kaspersky official blog
T
Threat Research - Cisco Blogs
PCI Perspectives
PCI Perspectives
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy & Cybersecurity Law Blog
O
OpenAI News
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
Cisco Blogs
AWS News Blog
AWS News Blog
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
美团技术团队
T
Threatpost
S
Schneier on Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
Cyber Attacks, Cyber Crime and Cyber Security
Last Week in AI
Last Week in AI
C
CERT Recently Published Vulnerability Notes
Blog — PlanetScale
Blog — PlanetScale
C
Cybersecurity and Infrastructure Security Agency CISA
F
Full Disclosure
博客园_首页
N
Netflix TechBlog - Medium
Security Latest
Security Latest
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Register - Security
The Register - Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Recent Announcements
Recent Announcements
博客园 - Franky
P
Palo Alto Networks Blog
Project Zero
Project Zero
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
H
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Cisco Talos Blog
Cisco Talos Blog
H
Heimdal Security Blog
The Hacker News
The Hacker News
博客园 - 【当耐特】
GbyAI
GbyAI

博客园 - Beewolf

MarkdownToMediaWiki AI时代开发的开发流程 Blazor下的serilog Oracle From VS2019 TO VS2022问题处理 PLINQ实现Map/Reduce模式 学习 异步编程 oracle vs2019 edmx 更改 CentOS 7安装odoo 15 删除ELK的索引 ELK故障处理,不知道成功否 软件开发的SOLID原则 阿里云的远程桌面问题 Zabbix增加邮箱后Server宕处理 201811招投标培训要点 openvas scanner 服务未启动修复 Hacker一月间 U盘安装kali中CDROM问题解决 测量衰老 tensorFlow小结 tensorFlow可以运行的代码
基于微软的RDP远程桌面共享排错
Beewolf · 2022-05-26 · via 博客园 - Beewolf

近日研究了网络流,文件流,自然的又开始研究视频流,然后就用到了微软的RDP开发,网站中有两篇文章帮助极大,如下所示:

基于RDP的桌面广播  这个有下载的文档,可以研究研究。

RDPSession的远程桌面共享  这个有解释,但会报错。

所以两者结合是比较好了。

采用共享的解释,我码好程序,运行:灾难性故障 (异常来自 HRESULT:0x8000FFFF (E_UNEXPECTED)),查看端报错!

编译没有问题,出现错误的语句在:

 private void button1_Click(object sender, EventArgs e)
        {

            Thread thread1 = new Thread(new ThreadStart(RDPConnect));
            thread1.Start();

        }

        private void RDPConnect()
        {  
            try
            {
                
                axRDPViewer1.Connect(textBox1.Text, "Test001", "");
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
         }

   axRDPViewer1.Connect(textBox1.Text, "Test001", "");

多种可能:text拷贝的地方有问题?Connect参数问题?.net版本问题?

于是运行第一篇博客的程序,发现运行正常。只是有点绕,他在代码里加入了

var dlg = new CaptureScreen()
            {
                Owner = this
            };
            var result = dlg.ShowDialog();
            if (result == DialogResult.No) return;
            Rectangle rect = new Rectangle(0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
            if (result == DialogResult.Yes)
            {
                rect = dlg.SelectedRectangle;
            }

这样的代码,然后:

   //_rdpSession.SetDesktopSharedRect(0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
   _rdpSession.SetDesktopSharedRect(rect.X, rect.Y, rect.Right, rect.Bottom);

给人感觉共享一个区域,而我只是想看看整个桌面。

我用调试查看他的  invitation 片段:Y3TtbRTFyk8RHgHDv9Y=" ID="PalmaeTech"/><C><T ID="1" SID="0"><L P="65016" N="fe80::ec5

而我在代码中查看到的片段是:Y3TtbRTFyk8RHgHDv9Y=" ID="PalmaeTech"/></E> 缺少<C><T>

用其share段的代码,采用我写的client是能够看到远程桌面的,问题应该出现在share的代码有问题。

仔细对比两者,发现了问题所在:

_rdpSession.SetDesktopSharedRect(0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
                //_rdpSession.SetDesktopSharedRect(rect.X, rect.Y, rect.Right, rect.Bottom);

                _rdpSession.Open();


                IRDPSRAPIInvitation invitation = _rdpSession.Invitations.CreateInvitation("PalmaeTech", "CastGroup", "",
                    64);

正常的代码

_rdpSession.Open();在invitation之前!!!

这就正常了,如果后open先invitation,会导致缺少网络信息,所以就出现恐怖的灾难性故障。