获取Skype聊天列表

时间:2016-01-20 19:09:06

标签: c# .net skype4com

我只是试图获取聊天列表,但我无法得到它。

function loadData() {

  var text = '{
    "name": "",
    "type": "",
    "features": [{
      "type": "",
      "geometry": {
        "type": "",
        "coordinates": [279947.135830549, 356999.268696635]
      },
      "properties": {
        "**title": "",
        "timestamp": "",
        "id": "",
        "pos_acc": -1,
        * * "Broad_Habi": "" * * ,
        "geom_X": 53.09665139,
        "geom_Y": -3.79436993599,
        "Image": "",
        "Name": "",
        "Species_Id": "",
        "Approx_Hei": "",
        "Evidence_o": "",
        "Distance_f": "",
        "River_Bank": "",
        "Describe_T": "",
        "Describe_W": "",
        "Field_Comm": "",
        "Make_and_M": "",
        "Azimuth": 145.238262662,
        "editor": "",
        "Pitch": -25.5942265843,
        "OS_Version": "",
        "Roll": 12.322497107 1
      }
    }, {
      "type": "",
      "geometry": {
        "type": "",
        "coordinates": [280443.642983406, 358907.166228556]
      },
      "properties": {
        "title": "",
        "timestamp": "",
        "id": "",
        "pos_acc": -1,
        "Broad_Habi": "",
        "geom_X": 53.1139046729,
        "geom_Y": -3.78766989708,
        "Image": "",
        "Name": "",
        "Species_Id": "",
        "Approx_Hei": "",
        "Evidence_o": "",
        "Distance_f": "",
        "River_Bank": "",
        "Describe_T": "",
        "Describe_W": "",
        "Field_Comm": "",
        "Make_and_M": "",
        "Azimuth": 166.585854989,
        "editor": "",
        "Pitch": -48.7309271996,
        "OS_Version": "",
        "Roll": 8.1962176125 1
      }
    }]
  }';
  obj = JSON.parse(text);
  console.log(obj.features.length);

  for (var i = 0; i < obj.properties.length; i++) {
    var currentObj = obj.properties.[i];
    console.log(currentObj);
    var mytitle = currentObj.title;
    console.log(mytitle);
    var habitat = currentObj.Broad_Habi;
    console.log(habitat);
    var table = document.getElementById("myTableData");

    var rowCount = table.rows.length;
    var row = table.insertRow(rowCount);
    row.insertCell(0).innerHTML = '<input type="button" value = "Delete" onClick="Javacsript:deleteRow(this)">';
    row.insertCell(1).innerHTML = mytitle;
    row.insertCell(2).innerHTML = habitat;
  }
}

它不包括所有聊天记录。我创建了一个新的,无法在列表中看到它。

1 个答案:

答案 0 :(得分:0)

这将显示所有聊天,包括隐藏的聊天。因此,您可能会看到只有单个联系人

的聊天重复。

Imports SKYPE4COMLib

Public Class Form1
Dim skype As Skype

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

    For Each r As Chat In skype.Chats
        'If topic = "", then it is an individual chat
        If r.Topic <> "" Then
            RichTextBox1.AppendText(r.Topic & vbCrLf)
        Else
            'If topic = "", then display the FriendlyName instead (individual chat)
            RichTextBox1.AppendText(r.FriendlyName & vbCrLf)
        End If

    Next
End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    skype = New Skype()
    skype.Attach(7, True)
End Sub
End Class