1

I have this situation over here, where I have placed the application I've developed in the windows Startup folder. I'm launching it every time the PC is started. But then how do I get the LyncClient at that instance? Because my application is being launched before Lync has been started. So basically my application will not start because whenever it comes to this line, var getclient = LyncClient.GetClient();, it will prompt an error, the host process is not running.

Is there a way for me to keep waiting until LyncClient.GetClient() is not null? And then continue executing my codes once i know that lync is running?

4

1 回答 1

0

抱歉,如果我浪费了任何人的时间,但我决定采用这种解决方法,这并不是那么好,但我认为无论如何我都应该分享它。

    Process[] pname = Process.GetProcessesByName("communicator");
    while (pname.Length == 0) 
    {
        pname = Process.GetProcessesByName("communicator");
    }
    var getclient = LyncClient.GetClient();

希望有人有比这更好的解决方案。

于 2013-03-29T01:57:38.990 回答