我想从IE浏览器中打开的下拉列表中记录selectedItem。以下是我在我的c#程序上获取浏览器事件的代码,它正在工作但我无法从浏览器中获取所选文本的列表项。
private void htmlDoc_KeyUp(IHTMLEventObj e)
{
var eventData = new EventDetail()
{
TimeStamp = DateTime.Now,
TargetControl = new ControlDetail()
{
Id = e.srcElement.id,
Name = e.srcElement.title,
ControlType = e.srcElement.tagName,
//LabelledBy = e.srcElement.outerHTML
},
Action = EventActions.KU,
Data = Convert.ToChar(e.keyCode).ToString(),
CursorLocation = new System.Windows.Point(e.screenX, e.screenY)
};
eventData.ToString().AppendToTextFile(logFilePath);
}