April 2006 Blog Posts
Along the lines of Background Worker Classes I recently posted on (found here), there is an MSDN Webcast I just watched live that is pretty cool. Albeit, I got in late, I plan on watching it again. What I found very appealing was the Distributed Computing approach he demonstrated via Web Services. The response time is absolutely appealing to the performance-minded developer.
Check it out here...
MSDN Webcast: Advanced Grid Programming (Level 200)
Yesterday, I posted an entry about the BackgroundWorker class and how it helped me out recently. I also mentioned that I uploaded bulk documents into a SharePoint Form Library. I thought I'd share a piece of code that made this task easy.
For Each foundFile As String In My.Computer.FileSystem.GetFiles( _ My.Computer.FileSystem.CurrentDirectory, _ FileIO.SearchOption.SearchAllSubDirectories, "*.xml")
'this line used to see status monitoring - adjust to your needs Thread.Sleep(2000)
Dim foundFileInfo As New System.IO.FileInfo(foundFile)
Me.ToolStripStatusLabel1.Text = "Uploading " & foundFileInfo.Name
Dim webClient As New System.Net.WebClient()
webClient.Credentials = System.Net.CredentialCache.DefaultCredentials
webClient.UploadData("http://abcd.domain.com/C7/SharePoint Site Name/Form Library Name/" + foundFileInfo.Name, "PUT", GetFile(foundFileInfo.FullName))
Catch ex As Exception
Recently I was tasked with writing a quickie application that would convert a Custom List in SharePoint to an InfoPath Form Library. While I was looking around at all the new class libraries in .Net 2.0, I happened across the BackgroundWorker Class (System.ComponentModel). This proved to be just the ticket for what I was wanting to do, an asynchronous approach of processing a mass load of documents. Here's a 10K view of what I did:
Private Sub convertButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles convertButton.Click
Private Function Convert( _ ByVal bw As BackgroundWorker, _ ByVal sleepPeriod As Integer)...