Ga naar inhoud

VB 6.0, probleem met kopieren


anoniem

Aanbevolen berichten

Ok ik heb programmaatje dat video afspeeld, wil hem nu een .part bestand laten omzetten in een .mpg bestand en deze eers kpieren en dan afspelen Dit heb ik [code:1:419ee668e3] Private Sub Command1_Click() Dim bestandsnaam As String cdlKies.InitDir = "C:\" cdlKies.Filter = "Video|*.mpeg;*.mpg;*.avi;*.wmv|Alle bestanden|*.*" cdlKies.ShowOpen bestandsnaam = cdlKies.FileName msspeler.FileName = bestandsnaam End Sub Private Sub Command2_Click() msspeler.Height = 10000 msspeler.Width = 11000 End Sub Private Sub Command3_Click() msspeler.Height = 4815 msspeler.Width = 5295 End Sub Private Sub Command4_Click() formbreedte = Form1.Width formbreedte2 = formbreedte - 2500 formhoogte = Form1.Height formhoogte2 = formhoogte - 500 msspeler.Width = formbreedte2 msspeler.Height = formhoogte2 End Sub Private Sub Command5_Click() If txtVariabele.Text = 0 Then filFile.Visible = False txtVariabele.Text = 1 Exit Sub End If If txtVariabele.Text = 1 Then filFile.Visible = True txtVariabele.Text = 0 Exit Sub End If End Sub Private Sub Command6_Click() Dim oudebestandsnaam As String oudebestandsnaam = filTempfiles.FileName x = Shell("copy " + DirFolder.Path & "\" & filTempfiles.FileName + " c:\emule preview\temp\" + oudebestandsnaam$) adres = "c:\emule previeuw\temp" + oudebestandsnaam$ msspeler.FileName = adres End Sub Private Sub filFile_DblClick() 'Get the filename from the FileListBox control. adres = DirFolder.Path & "\" & filFile.FileName End Sub Private Sub Dirfolder_Change() 'Set the folder displayed in the FileListBox 'control to the user's selection. filFile.Path = DirFolder.Path filTempfiles.Path = DirFolder.Path End Sub Private Sub drvDrive_Change() 'Set the drive displayed in the DirListBox 'control to the user's selection. DirFolder.Path = drvDrive.Drive End Sub Private Sub filTempfiles_DblClick() adres = DirFolder.Path & "\" & filTempfiles.FileName End Sub Private Sub Form_Load() On Error GoTo Fault txtVariabele.Text = 0 DirFolder.Path = "d:\3dMark2001 SE\data\temp" drvDrive.Drive = "d:\" Exit Sub Fault: Select Case Err.Number 'Evaluate Error Number Case 76 DirFolder.Path = "c:\" drvDrive.Drive = "c:\" Case Else MsgBox "Er klopt iets niet" End Select End Sub [/code:1:419ee668e3] Helaas blijkt de copy niet te werken en het hernoemen heb ik nog niet maar dat is niet noodzakelijk voor windowsmediaplayer
Link naar reactie
[quote:b647a25710="sdk"] [code:1:b647a25710] x = Shell("copy " + DirFolder.Path & "\" & filTempfiles.FileName + " c:\emule preview\temp\" + oudebestandsnaam$) [/code:1:b647a25710] [/quote:b647a25710] [code:1:b647a25710] Declare Function CopyFileA Lib "kernel32" Alias "CopyFileA" ( _ ByVal lpExistingFileName As String, _ ByVal lpNewFileName As String, _ ByVal bFailIfExists As Long) As Long public function CopyFile(byval SourceFileName as string, _ byval TargetFileName as string, _ byval FailIfTargetExists as Boolean) as Boolean Err.Clear CopyFile = CopyFileA(SourceFileName,TargetFileName,clng(FailifTargetExists)) ) then if (not CopyFile) then Call MsgBox(Err.Description) endif end function [/code:1:b647a25710] Aanroep: [code:1:b647a25710] CopyFile("c:\temp\bron.avi","c:\temp\destination.avi",True) [/code:1:b647a25710]
Link naar reactie
Ik heb al iets dat werkt, Filecopy Source, Destination waarbij isk de 2 variablelen van te voeren declareer. Er is alleen 1 probleem als ik de paths in een picturebox laat zien zie ik waarom er een fout optreed als ik een bestand van c:/ gebuik. Hij neemt dan namelijk c://bestand.mpg dus een / te veel. Heb dit nog niet opgelost, zal morgen de nieuwe code plakken, kan er nu namelijk niet bij. (andere pc)
Link naar reactie

Om een reactie te plaatsen, moet je eerst inloggen

Gast
Reageer op dit topic

×   Geplakt als verrijkte tekst.   Herstel opmaak

  Er zijn maximaal 75 emoji toegestaan.

×   Je link werd automatisch ingevoegd.   Tonen als normale link

×   Je vorige inhoud werd hersteld.   Leeg de tekstverwerker

×   Je kunt afbeeldingen niet direct plakken. Upload of voeg afbeeldingen vanaf een URL in

×
×
  • Nieuwe aanmaken...