几个月来,我一直试图使用内置在我的应用程序中的windows中的“主动提供远程协助”功能,但没有成功。
需要明确的是,这正是msra /offerRA计算机名的相同功能。专家可以为新手提供远程帮助,而不需要新手手动创建代码串。据我所知,这是使用DCOM来使用RAserver来通信信息,然后由MSRA接管实际的连接。我已经确认我可以使用MSRA /OfferRA ComputerName,所以功能是存在的。
我尝试过许多API/DLL,但我仍然不知道如何在OFFERRA中提供远程帮助
我已经尝试了以下模块。AxRDPCOMAPILib RDPCOMAPILib RAServerLib RendezvousSessionLib
我尝试了这么多不同的代码变体,不可能将它们全部张贴在这里。我需要一些帮助,以了解如何使用的OfferRA功能。我不想将点对点应用程序缓存起来。我希望我的应用程序使用从Microsoft安装在其计算机上的MSRA连接到客户端计算机上的远程帮助。
任何帮助都将不胜感激。
尝试Code1:
AxRDPViewer Viewer = new AxRDPViewer();
Viewer.BeginInit();
Viewer.SuspendLayout();
RemoteAssistanceWindow.Child = Viewer;
Viewer.ResumeLayout();
Viewer.EndInit();
((AxRDPViewer)RemoteAssistanceWindow.Child).Connect("DZ0006", "MySecretUsername", "MySecretPassword");结果:
System.ArgumentException类型的第一次例外发生在AxRDPCOMAPILib.dll中
程序'4936 Enterprise.vshost.exe:程序跟踪‘已退出代码0 (0x0)。
程序'4936 Enterprise.vshost.exe‘已退出与代码-1073741819 (0xc0000005)’访问违规‘。
更新2:
RDPViewer Viewer = new RDPViewer();
IMRequestRA Request = new IMRequestRA();
Request.SetRendezvousSession(Viewer);线程0x1c60与代码259 (0x103)一起退出。
程序'7520 Enterprise.vshost.exe:程序跟踪‘已退出代码0 (0x0)。
程序'7520 Enterprise.vshost.exe‘已退出与代码-1073741819 (0xc0000005)’访问违规‘。
发布于 2015-01-23 08:29:29
使用MSRA Exe及其参数的远程协助。
在这里,我设计了一个类和一个表单,它提供了以下功能,
使用以下控件设计窗体,
表格后面的代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace RemoteAssist
{
public partial class FrmConnect : Form
{
public FrmConnect()
{
InitializeComponent();
}
private void btnConnect_Click(object sender, EventArgs e)
{
RemoteConnect remoteConnect = new RemoteConnect();
Boolean status = remoteConnect.StartRemoteAssistance(txtComputerName.Text.ToString(), true,false);
if (status == false)
{
System.Windows.Forms.MessageBox.Show("Unable to Connect to the Remote Machine.Please try Again later.");
}
}
private void BtnInvite_Click(object sender, EventArgs e)
{
RemoteConnect remoteConnect = new RemoteConnect();
Boolean status;
status = remoteConnect.StartRemoteAssistance(txtComputerName.Text.ToString(), false, true);
if (status == false)
{
System.Windows.Forms.MessageBox.Show("Unable to Establish Connection, Please try Again later.");
}
}
private void FrmConnect_Load(object sender, EventArgs e)
{
}
private void txtComputerName_TextChanged(object sender, EventArgs e)
{
txtComputerName.CharacterCasing = CharacterCasing.Upper;
}
}
}这里有两个按钮,它们将布尔变量发送到类函数,以区分提供帮助和请求帮助。
类文件下的代码: RemoteConnect
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RemoteAssist
{
class RemoteConnect
{
public Boolean StartRemoteAssistance(String strMachinename, Boolean offerHelp, Boolean askForHelp)
{
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
startInfo.FileName = "msra.exe";
// Offer Remote Assitance
if (offerHelp == true)
{
startInfo.Arguments = "/offerRA " + strMachinename;
}
//ASK for Remote Assistance
if (askForHelp == true)
{
startInfo.Arguments = "novice";
}
try
{
process.StartInfo = startInfo;
process.Start();
return true;
}
catch (Exception ex)
{
//System.Windows.Forms.MessageBox.Show("Error Occured while trying to Connect" + ex.Message);
return false;
}
}
}
}https://stackoverflow.com/questions/24357662
复制相似问题