下面的代码最初只是根据名称从列表视图中删除了一个用户。我想添加首先将列表视图的标签属性写入文本文件的功能,但我对如何在删除它之前指定我想要标签的列表视图项目感到困惑。有人可以给我建议吗?谢谢。
Public Sub RemoveUser(ByVal name As Object)
If _mainView.lvwChannelUsers.InvokeRequired Then
_mainView.lvwChannelUsers.Invoke(New ParameterizedThreadStart(AddressOf RemoveUser), name)
Else
Dim lvi As ListViewItem = GetListViewItemsIndex(DirectCast(name, String))
Dim FILE_NAME As String = Application.StartupPath & "\accounts\" & DirectCast(name, String)
Dim objWriter As New System.IO.StreamWriter(FILE_NAME)
objWriter.Write("This is where I need to call the tag to write.")
objWriter.Close()
_mainView.lvwChannelUsers.Items.Remove(lvi)
End If
End Sub