Hello People I made this code
Could someone help me make an alert to show in the end how many files are modified?
See code:
Thank you in advance VB MembersCode:Public Class SdlStudioChanger Private Sub BT_Browse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT_Browse.Click ' Set Folder PATH default FolderBrowserDialog1.SelectedPath = My.Computer.FileSystem.SpecialDirectories.MyDocuments ' Show the new folder button FolderBrowserDialog1.ShowNewFolderButton = True If FolderBrowserDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then ' Get the full path to the file that selected by the user. Dim mySelFile As String = FolderBrowserDialog1.SelectedPath ' Displays the full path of the file selected by the user in the box (TextBox) Tb_FilePath.Text = mySelFile 'Displays the folder name (only) selected, the user"Subtlety, use the" IO.Path.GetFileName "on the path to a folder 'To get the name of the target folder. 'While "IO.Path.GetDirectoryName" would have shown you the folder path CONTAINING file 'Targeted by the specified path as a parameter 'MsgBox("Du har valt: " & IO.Path.GetFileName(mySelFile)) For Each filename As String In IO.Directory.GetFiles(mySelFile, "*.xml") Dim analyse Dim exactContexts Dim subnode Dim repeated Dim realRepeated Dim tmpValue As String = "" Dim contextModified As Integer = 0 Dim repeatModified As Integer = 0 analyse = CreateObject("Msxml2.DOMDocument.6.0") analyse.Load(filename) exactContexts = analyse.SelectNodes("//inContextExact") For i = 0 To exactContexts.Length - 1 subnode = exactContexts(i) For Each att In subnode.Attributes If att.Name = "words" Then att.Value = "0" Exit For End If Next att Next i repeated = analyse.SelectNodes("//crossFileRepeated") For i = 0 To repeated.Length - 1 subnode = repeated(i) For Each att In subnode.Attributes If att.Name = "words" Then tmpValue = att.Value If att.Value <> 0 Then contextModified = contextModified + 1 att.Value = "0" Exit For End If Next att realRepeated = subnode.NextSibling For Each att In realRepeated.Attributes If att.Value <> 0 Then repeatModified = repeatModified + 1 If att.Name = "words" Then att.Value = Val(att.Value) + Val(tmpValue) Exit For End If Next att Next i analyse.Save(filename) Next Else 'if the user has not selected a folder, it is a warning MsgBox("Ingen fil vald", MsgBoxStyle.Exclamation, "Inga markerade mappar") End If End If End Sub




Reply With Quote
