VB-NET building project from template doesn't run

Author Message
MikiBear 09/10/2011 05:22 am
Hi,

I tried to download one web page including all files using the VB.NET code below. To create a project I loaded one from an existing template. In templates no directories can be assigned.

Download runs very fast - more fast, as expected. But IOEProject.MapEntriesCount shows a lot of files.

I tried to save a directory name in IOEFolder.Directory. This value should be a string, but always IOEFolder.Directory returns "nothing" (= no object). IOEFolder object exists, after taking it using IOEProject.FetFolder, but contains nothing and nothing can be assigned.

Is it even possible to create a project from a template?

I would appreciate help.

Michael


---Code---------------------------------

If ManOE IsNot Nothing Then
' Searching for template
Dim TplIndex As Integer = -1
For i As Integer = 0 To ManOE.TemplatesCount - 1
If ManOE.GetTemplate(i).Caption = "AS_Template" Then
TplIndex = i
Exit For
End If
Next
' If template found
If TplIndex > -1 Then
' Load template as project
Dim ManPJ As OE.IOEProject = ManOE.GetTemplate(TplIndex)
If ManPJ IsNot Nothing Then
' Set URL
ManPJ.URL = "http://www.vox.de/rezepte/anzeigen/duell/rezept/401955/id/507/Karotten-Ingwer-Suppe-mit-Garnelen-Spiess"
Dim ManFld As OE.OEFolder = ManPJ.GetFolder
' Set directory
ManFld.Directory = "C:\MhtQuick"
ManPJ.Start()
Dim DlStatus As Integer = -1
Dim DlReady As Boolean = False
While Not DlReady
DlStatus = ManPJ.GetStatus
Select Case DlStatus
Case 2, 3, 4
DlReady = True
Exit While
Case Else
Threading.Thread.Sleep(1000)
End Select
End While
' Show Mapentries
MessageBox.Show(ManPJ.MapEntriesCount.ToString)
' Show the directory name
MessageBox.Show("Fertig: " & ManPJ.GetFolder.Directory)
' Export
ManPJ.Export("C:\MhtQuick", OEExportPutTo.OEPT_Directory, 0, 1, 0, OEFilenamesFormat.OEFF_83, 0)
End If
ManPJ = Nothing
End If
End If
Oleg Chernavin 09/13/2011 03:52 pm
Sorry for the late answer!

I made it simplier. I added the IOEProject.Directory property. So, now you don't have to change the Folder directory.

Here is the updated version:

http://www.metaproducts.com/download/betas/eebsetup.exe

Please let me know how it works. Thank you!

Best regards,
Oleg Chernavin
MP Staff