远程访问WCF中默认Web浏览器的属性 [英] Remotely access properties of default Web Browser in WCF

查看:83
本文介绍了远程访问WCF中默认Web浏览器的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好:



我的WCF服务需要远程打开消费者计算机上的默认Web浏览器并监控其浏览器事件以便捕获其中一个属性的值(本例中为document.title)。我已经可以打开Internet Explorer并在其上导航(使用Process.Start方法),但我不喜欢这种方法,因为它不能让我能够监视浏览器的事件。



我该怎样才能这样做?



这里有一个小例子展示我正在做什么来从WCF远程打开Internet Explorer service:

 使用 System.Diagnostics; 

public void OpenRemoteBrowser();
{
Process InternetExplorer = new Process()
InternetExplorer.StartInfo.FileName = iexplore.exe;
InternetExplorer.StartInfo.Arguments = http://< url url>;
InternetExplorer.Start();
}





请帮忙!我需要尽快解决这个问题:-S

解决方案

不可能。在Web服务器上运行的代码无法在客户端计算机上启动可执行文件,更不用说监视事件了。


即使有了进一步的解释,您的想法似乎过于复杂而无法实现好处,但也指出安全风险太高。



从您的描述中,您可能希望存储所述社交媒体网站的用户凭据您自己的系统,然后将它们传递到社交媒体网站进行身份验证。如果这不是你的想法,我会提前道歉说这个,但这简直太糟糕了。试想那个场景中可能发生的坏事。



如果你正在寻找一个有多个选项的中央授权系统,我建议你看一下Thinktecture IdentityServer v3产品

Hello guys:

I need for my WCF service to remotely open the default web browser on the consumer computer and monitor its browser events in order to capture the value of one of its properties (document.title in this case). I can already open Internet Explorer and navigate on it (using the Process.Start method), but I'm not liking this method since it doesn't give me the ability to monitor the browser's events.

How can I go about doing this?

Here's a little example showing what I'm doing to open Internet Explorer remotely from the WCF service:

using System.Diagnostics;

public void OpenRemoteBrowser();
{
 Process InternetExplorer = new Process()
 InternetExplorer.StartInfo.FileName = "iexplore.exe";
 InternetExplorer.StartInfo.Arguments = "http://<whatever url>";
 InternetExplorer.Start();
}



Please help! I need to resolve this one ASAP :-S

解决方案

Not possible. Code running on a web server can NOT launch an executable on a client machine, let alone "monitor" it for events.


Even with the further explanation your idea seems overly complicated to achieve very little benefit, but as also pointed out the security risk are just too high.

From your description it sounds like you want to store the users credentials for said social media site on your own system and then pass those to the social media site for authentication. If that is not your idea, I apologize in advance for saying this, but that is just plain bad. Just think the bad things that could happen in that scenario.

If you are looking for a central authorization system with several options, I would suggest you look at Thinktecture IdentityServer v3 product.


这篇关于远程访问WCF中默认Web浏览器的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆