简体   繁体   English

如何在Skype中结束当前通话

[英]How to end an active call in skype

I am using the Skype API for video calling. 我正在使用Skype API进行视频通话。 Now I have a button to end the call. 现在,我有一个结束通话的按钮。 I wrote the following code on button's click: 我在按钮的单击上编写了以下代码:

if (skype.ActiveCalls.Count > 0)
{
    skype.ActiveCalls[0].Finish();

    //conference calls
    //for (int i = 0; i < skype.ActiveCalls.Count; i++)
    //{
        //if (skype.ActiveCalls[i + 1].ConferenceId > 0)
        //{
            //skype.ActiveCalls[i + 1].Finish();
            //call = skype.;
        //}
    //}
}

but it is throwing exception: 但它抛出异常:

Value does not fall within the expected range. 值不在预期范围内。

How to end an active call? 如何结束通话?

Well my guess from the commented code 好吧,我从注释代码中得出的猜测

//conference calls 
//for (int i = 0; i < skype.ActiveCalls.Count; i++) 
//{ 
    //if (skype.ActiveCalls[i + 1].ConferenceId > 0) 
    //{ 
        //skype.ActiveCalls[i + 1].Finish(); 
        //call = skype.; 
    //} 
//}

is that the ActiveCalls arrays is not zero based, and starts from 1, 是ActiveCalls数组不是从零开始的,而是从1开始

so you should change 所以你应该改变

skype.ActiveCalls[0].Finish();

to

skype.ActiveCalls[1].Finish(); 

Juat a guess 猜猜

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM