|
Liste/Catalogue automatique des jeux Wii- ForumTopic: Liste/Catalogue automatique des jeux Wiipar![]() Prog. pour faire auto. une liste des jeux Wii sous Win (ISO/RAR)Je n'ai pas trouvé de programme Windows pour ce genre d'opération. Je voudrais trouver de l'aide pour effectuer un programme sous Windows qui me permettra de générer une liste de mes jeux Wii backup (ISO & RAR) qui se trouve sur mon DD. Ne connaissant pas la programmation sous Windows (je suis encore un ancien du DOS avec de l'assembler et du C/C++), j'ai commencé en VBS. 1) Le programme recherche dans un répertoire demandé les fichiers ISO et RAR. 2) Lorsqu'un fichier ISO est trouvé, il lit les 6 premiers caractères pour avoir le code du jeu. 3) Lorsqu'un fichier RAR est trouvé, il extrait le RAR partiellement et idem que le 2) lit les 6 caractères. 4) J'écris dans un CSV le nom du fichier, le format (ISO/RAR), la taille du fichier, le code du jeu Wii. Par la suite, j'aimerai ajouter dans ce CSV : 1) Le nom officiel du jeu (FR ou ENG si pas de FR) 2) Les langues du jeu 3) L'image du jeu (cover) FR ou ENG si pas en FR 4) Le descriptif 5) ... Ces infos, je pense qu'il est possible de les prendre de certains sites comme wiitdb mais je ne sais pas comment prendre directement la bonne info. Je sais lire la page Web du jeu en script mais alors il faut décoder la page pour trouver les infos. Si le site change de design, il faudra alors tout refaire. Cela je ne le souhaite pas. Je suppose qu'il y a moyen de prendre les infos du site en faisant les bonnes requêtes comme le ferai USB Loader GX. Code : Const BIF_EDITBOX = &H10 Const BIF_NONEWFOLDER = &H0200 Const BIF_RETURNONLYFSDIRS = &H1 Const BIF_NEWDIALOGSTYLE = &H40 Const ForReading = 1 Const TristateFalse = 0 StrRelativeTempPath="MyUnrar" StrTempPath="" Set objShell = CreateObject("Shell.Application") Set wshShell = CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") '**Browse For Folder To Be Processed strPrompt = "Please select the folder to process." intOptions = BIF_NEWDIALOGSTYLE + BIF_RETURNONLYFSDIRS + BIF_NONEWFOLDER + BIF_EDITBOX strTargetPath = wshShell.SpecialFolders("MyComputer") 'strTargetPath = "C:\Mes fichiers\IDM\Wii\_new" strFolderPath = Browse4Folder(strPrompt, intOptions, strTargetPath) if right(strTargetPath,1)="" then StrTempPath=StrTargetPath & StrRelativeTempPath else strTempPath=strFolderPath & "" & StrRelativeTempPath end if Set objNewFile = objFSO.CreateTextFile(strFolderPath & "\Wiilist.csv", True) Set objMyFolder = objFSO.GetFolder(strFolderPath) Set objColFiles = objMyFolder.Files objNewFile.WriteLine("File Name;Extension;File Size;Code") For Each file In objColFiles CurrentName=objFSO.getbasename(file.Name) CurrentExtension=ucase(objFSO.getextensionname(file.Name)) If CurrentExtension = "ISO" Or CurrentExtension = "RAR" Then ThisCode=CodeName(strFolderPath & "" & file.Name,CurrentExtension) objNewFile.WriteLine(CurrentName & ";" & CurrentExtension & ";" & file.Size & ";" & ThisCode) End If Next objNewFile.Close wscript.quit Function Browse4Folder(strPrompt, intOptions, strRoot) Dim objFolder, objFolderItem On Error Resume Next Set objFolder = objShell.BrowseForFolder(0, strPrompt, intOptions, strRoot) If (objFolder Is Nothing) Then Wscript.Quit End If Set objFolderItem = objFolder.Self Browse4Folder = objFolderItem.Path Set objFolderItem = Nothing Set objFolder = Nothing End Function Function CodeName(CurrentGame,FileType) Select Case FileType Case "ISO" : CodeName=ReadCodeISO(CurrentGame) Case "RAR" : CodeName=ReadCodeRAR(CurrentGame) End Select End Function Function KillMyUnrar strComputer="." Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\" & strComputer & "\root\cimv2") Set colProcessList = objWMIService.ExecQuery ("SELECT * FROM Win32_Process WHERE Name = 'MyUnrar.exe'") For Each objProcess in colProcessList objProcess.Terminate() Next End Function Function ReadCodeISO(CurrentGame) Dim objFS, objFile, objTS Set objFS = wscript.CreateObject("Scripting.FileSystemObject") Set objFile = objFS.GetFile(CurrentGame) Set objTS = objFile.OpenAsTextStream(ForReading, TristateFalse) ReadCodeISO = objTS.Read(6) End Function Function ReadCodeRAR(CurrentGame) Dim objLastEvent Set fso = CreateObject("Scripting.FileSystemObject") If fso.FolderExists(strTempPath) Then fso.DeleteFolder strTempPath,0 End If Set f = fso.CreateFolder(strTempPath) NewTempPath = f.Path if ucase(NewTempPath)<>ucase(strTempPath) then Wscript.echo("Error Temp Path :" & NewTempPath & "-" & strTempPath) Wscript.quit end if set WshShell = CreateObject("WScript.Shell")' IntReturn=WshShell.Run("MyUnrar.EXE e -ai -kb -sm4600000000 " & Chr(34) & CurrentGame & Chr(34) & " " & Chr(34) & strTempPath & Chr(34),0,False) ISOFileFound=0 NewCurrentGame="" do wscript.sleep 300 Set objFolder = fso.GetFolder(strTempPath) Set objFiles = objFolder.Files For Each ISOFile in objFiles NewCurrentGame=strTempPath & "" & ISOFile.Name If UCase(Right(NewCurrentGame,4))=".ISO" Then KillMyUnrar ISOFileFound=1 Exit For End If Next loop until ISOFileFound MyCode=ReadCodeISO(NewCurrentGame) If UCase(Left(MyCode,6))= LCase(Left(MyCode,6)) Then wscript.echo "*" & MyCode & "*" If fso.FolderExists(strTempPath) Then fso.DeleteFolder strTempPath,0 wscript.echo "exist2" & strTempPath End If wscript.sleep 300 MyCode=ReadCodeRAR(CurrentGame) End if ' wscript.echo "*" & MyCode & "*" wscript.sleep 200 fso.DeleteFolder strTempPath,0 ReadCodeRAR=MyCode End Function Ce code marche bien pour un répertoire de Wii avec plein de ISO mais pour un répertoire plein de RAR, j'ai quelques erreurs et il bloque pas toujours au même endroit si je lance plusieurs fois le programme avec la même sélection. ![]() Si quelqu'un pouvait m'aider ou éventuellement refaire le code dans un language plus approprié avec éventuellement une interface utilisateur (GUI). Pour info : le MyUnrar.exe, c'est juste le programme unrar.exe renommé (présent avec l'installation de Winrar) Merci Pages: 1 Messages:
Pages: 1 Ajouter commentaire: Créez un compte ou identifiez vous pour poster un commentaire. Pour votre téléphone, Jailbreak iPhone et Jailbreak iPad. - Hack PS3 - Hacker sa WiiU - Hacker PS Vita - Rage Comics, troll face - Retrouvez chaque jour des image drole sur internet grâce à LOLTube. - Meme Internet |
114 connectés (0 membre, 114 anonymes) | © 2007-2015 Attila |