Dim doc As XDocument = XDocument.Load("game.xml") Dim environment_variable As String Dim path As String Dim IsFolderOnly As Boolean For Each Game As XElement In doc.Descendants("Game") IsFolderOnly Game.Element("IsFolderOnly").Attribute("FolderOnly") "YES" With Game.Element("location_path") environment_variable = .Attribute("environment_variable").Value path = .Attribute("path").Value End With If Directory.Exists(System.IO.Path.Combine(Update_Path(environment_variable), path)) Then ListBoxGames.Items.Add(Game.Attribute("name").Value) End If If IsFolderOnly Then '# [...] End If For Each File As XElement In (From Item In Game.Elements Where Item.Name.ToString() Like "file*_path") ListBox2.Items.Add(File.Attribute("filename").Value) Next Next
Dim doc As XDocument = XDocument.Load(DatabaseLocation) Dim games As IEnumerable(Of XElement) = From g In doc.Descendants("Game") For Each game As XElement In games Dim first As XElement = DirectCast(game.FirstNode, XElement) Dim IsFolderOnly As XElement = DirectCast(game.FirstNode.NextNode, XElement) Dim File0 As XElement = DirectCast(game.FirstNode.NextNode.NextNode, XElement) Dim File1 As XElement = DirectCast(game.FirstNode.NextNode.NextNode.NextNode, XElement) Dim File2 As XElement = DirectCast(game.FirstNode.NextNode.NextNode.NextNode.NextNode, XElement) Dim File3 As XElement = DirectCast(game.FirstNode.NextNode.NextNode.NextNode.NextNode.NextNode, XElement) Dim File4 As XElement = DirectCast(game.FirstNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode, XElement) Dim File5 As XElement = DirectCast(game.FirstNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode, XElement) Dim File6 As XElement = DirectCast(game.FirstNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode, XElement) Dim File7 As XElement = DirectCast(game.FirstNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode, XElement) Dim File8 As XElement = DirectCast(game.FirstNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode, XElement) Dim File9 As XElement = DirectCast(game.FirstNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode.NextNode, XElement) Dim last As XElement = DirectCast(game.LastNode, XElement) If ListBoxGames.Items.Contains(game.Attribute(game.FirstAttribute.NextAttribute.Name).Value) Then If System.IO.Directory.Exists(Update_Path(first.FirstAttribute.Value) & first.LastAttribute.Value) = True Then If IsFolderOnly.FirstAttribute.Value = "NO" Then If My.Computer.FileSystem.FileExists(File0.FirstAttribute.Value) Then My.Computer.FileSystem.CopyFile(File0.FirstAttribute.Value, Update_Path(last.FirstAttribute.Value) & last.LastAttribute.Value) Me.Refresh() End If If My.Computer.FileSystem.FileExists(File1.FirstAttribute.Value) Then My.Computer.FileSystem.CopyFile(File1.FirstAttribute.Value, Update_Path(last.FirstAttribute.Value) & last.LastAttribute.Value) Me.Refresh() End If If My.Computer.FileSystem.FileExists(File2.FirstAttribute.Value) Then My.Computer.FileSystem.CopyFile(File2.FirstAttribute.Value, Update_Path(last.FirstAttribute.Value) & last.LastAttribute.Value) Me.Refresh() End If If My.Computer.FileSystem.FileExists(File3.FirstAttribute.Value) Then My.Computer.FileSystem.CopyFile(File3.FirstAttribute.Value, Update_Path(last.FirstAttribute.Value) & last.LastAttribute.Value) Me.Refresh() End If If My.Computer.FileSystem.FileExists(File4.FirstAttribute.Value) Then My.Computer.FileSystem.CopyFile(File4.FirstAttribute.Value, Update_Path(last.FirstAttribute.Value) & last.LastAttribute.Value) Me.Refresh() End If If My.Computer.FileSystem.FileExists(File5.FirstAttribute.Value) Then My.Computer.FileSystem.CopyFile(File5.FirstAttribute.Value, Update_Path(last.FirstAttribute.Value) & last.LastAttribute.Value) Me.Refresh() End If If My.Computer.FileSystem.FileExists(File6.FirstAttribute.Value) Then My.Computer.FileSystem.CopyFile(File6.FirstAttribute.Value, Update_Path(last.FirstAttribute.Value) & last.LastAttribute.Value) Me.Refresh() End If If My.Computer.FileSystem.FileExists(File7.FirstAttribute.Value) Then My.Computer.FileSystem.CopyFile(File7.FirstAttribute.Value, Update_Path(last.FirstAttribute.Value) & last.LastAttribute.Value) Me.Refresh() End If If My.Computer.FileSystem.FileExists(File8.FirstAttribute.Value) Then My.Computer.FileSystem.CopyFile(File8.FirstAttribute.Value, Update_Path(last.FirstAttribute.Value) & last.LastAttribute.Value) Me.Refresh() End If If My.Computer.FileSystem.FileExists(File9.FirstAttribute.Value) Then My.Computer.FileSystem.CopyFile(File9.FirstAttribute.Value, Update_Path(last.FirstAttribute.Value) & last.LastAttribute.Value) Me.Refresh() End If End If If IsFolderOnly.FirstAttribute.Value = "YES" Then My.Computer.FileSystem.CopyDirectory(Update_Path(first.FirstAttribute.Value) & first.LastAttribute.Value, Update_Path(last.FirstAttribute.Value) & last.LastAttribute.Value, True) Me.Refresh() End If End If End If Next
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPour le IsFolderOnly "YES" j'ai trouver une solution.
? une solution à quoi ?