如何显示 PI Tag 搜索对话框,其次,如何从中获取选定的 tag 名称?
最佳答案
希望对你有用:
private void Button1_Click(object sender, EventArgs e) {
TagSearch dialog = new TagSearch();
PointList results = dialog.showTagSearch(
new string[] { }, SearchOptions.SingleSelect);
if (results.Count > 0) {
object index = 1;
string serverTag =
string.Format(
CultureInfo.InvariantCulture,
@"\\{0}\{1}",
results.get_Item(ref index).Server.Name,
results.get_Item(ref index).Name);
}
}
关于c# - 如何显示 PI tagsearch 对话框并将标记名作为字符串返回?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5277962/