This project is read-only.

Very slow

Jul 27, 2011 at 9:01 PM
Edited Jul 27, 2011 at 9:03 PM

Hello,

Im trying to get all map names out a folder nice in a list. It works correctly but, very very slow. It takes about half a minute to load 10 mapnames.

Is there a way to solve this?

 

Dim storage As AppLimit.CloudComputing.SharpBox.CloudStorage
        Dim token As ICloudStorageAccessToken
        Dim dropBoxConfiguratuon As ICloudStorageConfiguration
        Dim dropBoxCredentals As AppLimit.CloudComputing.SharpBox.DropBox.DropBoxCredentials
        dropBoxConfiguratuon = AppLimit.CloudComputing.SharpBox.DropBox.DropBoxConfiguration.GetStandardConfiguration()
        dropBoxCredentals = New AppLimit.CloudComputing.SharpBox.DropBox.DropBoxCredentials()
        dropBoxCredentals = New DropBoxCredentials()
        dropBoxCredentals.ConsumerKey = ""
        dropBoxCredentals.ConsumerSecret = ""
        dropBoxCredentals.UserName = ""
        dropBoxCredentals.Password = ""
        storage = New CloudStorage()
        token = storage.Open(dropBoxConfiguratuon, dropBoxCredentals)
        If (IsDBNull(storage)) Then
            MsgBox("Er is iets fout gegaan!!!")
        End If

        Dim files = storage.GetFolder("/Photos")

        ListBox1.Items.Clear()

        Dim aantalfiles = files.Count
        Dim i = 0
        Do Until i = aantalfiles
            subfolders(i) = files(i).Name
            ListBox1.Items.Add(subfolders(i))
            i += 1
        Loop


        If storage.IsOpened Then

            storage.Close()

        End If


Aug 21, 2011 at 11:05 AM
Hi,

it would be possible (for DropBox only) to check the hash to get the information if the file changed. This meta information will be transfered when you receive the folder information. This makes only sense if you cache the thumbs on your local disk.

Cheers
Dirk

2011/7/27 hardbassbv <notifications@codeplex.com>

From: hardbassbv

Hello,

Im trying to get all pictures out a folder nice in a list. It works correctly but, very very slow. It takes about half a minute to load 7 images (2Kb).

Is there a way to solve this?

If Not ListBox1.SelectedIndex = -1 Then
            Dim storage As AppLimit.CloudComputing.SharpBox.CloudStorage
            Dim token As ICloudStorageAccessToken
            Dim dropBoxConfiguratuon As ICloudStorageConfiguration
            Dim dropBoxCredentals As AppLimit.CloudComputing.SharpBox.DropBox.DropBoxCredentials
            dropBoxConfiguratuon = AppLimit.CloudComputing.SharpBox.DropBox.DropBoxConfiguration.GetStandardConfiguration()
            dropBoxCredentals = New AppLimit.CloudComputing.SharpBox.DropBox.DropBoxCredentials()
            dropBoxCredentals = New DropBoxCredentials()
            dropBoxCredentals.ConsumerKey = ""
            dropBoxCredentals.ConsumerSecret = ""
            dropBoxCredentals.UserName = ""
            dropBoxCredentals.Password = ""
            storage = New CloudStorage()
            token = storage.Open(dropBoxConfiguratuon, dropBoxCredentals)
            If (IsDBNull(storage)) Then
                MsgBox("Er is iets fout gegaan!!!")
            End If

            Dim pics = storage.GetFolder("/Tumb/" & ListBox1.Items.Item(ListBox1.SelectedIndex).ToString)
            Dim aantpics = pics.Count
            Dim i = 0

            If IO.Directory.Exists(System.IO.Path.GetTempPath & "picmanager\Tumbnails\") Then
                Dim u = 0
                Dim files = IO.Directory.GetFiles(System.IO.Path.GetTempPath & "picmanager\Tumbnails\")
                Do Until u = files.Length
                    IO.File.Delete(files(u))
                    u += 1
                Loop
            Else
                IO.Directory.CreateDirectory(System.IO.Path.GetTempPath & "picmanager\Tumbnails\")
            End If


            Dim placex = 0
            Dim placey = 0
            Do Until i = aantpics
                Dim picname = pics(i).Name
                Dim picpath = pics(i).Parent
                storage.DownloadFile(picpath, picname, System.IO.Path.GetTempPath & "picmanager\Tumbnails\")
                Dim pic As New PictureBox
                pic.Image() = New System.Drawing.Bitmap(System.IO.Path.GetTempPath & "picmanager\Tumbnails\" & picname.ToString)
                pic.Location() = New System.Drawing.Point((placex * 100 + placex * 5) + 3, (placey * 100 + placey * 5) + 3)
                pic.SizeMode() = PictureBoxSizeMode.Zoom
                pic.BorderStyle = BorderStyle.FixedSingle
                pic.Height = 100
                pic.Width = 100
                pic.Visible() = True
                Panel1.Controls.Add(pic)

                If placex < 3 Then
                    placex += 1
                Else
                    placex = 0
                    placey += 1
                End If
                i += 1
            Loop

        If storage.IsOpened Then

            storage.Close()

        End If

Read the full discussion online.

To add a post to this discussion, reply to this email (sharpbox@discussions.codeplex.com)

To start a new discussion for this project, email sharpbox@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com