I just read a post stating that the Visual Studio 2008 VPCs are expiring on November 1st, 2007. It is recommended that you backup any data that you don’t want to lose as soon as possible. More information can be found at http://blogs.msdn.com/jeffbe/archive/2007/10/25/vs2008-beta2-vpcs-expiring-prematurely.aspx.
I’ve been getting emails from numerous people about a Pennsylvania Cell Phone ban. There’s been two different letters going around. One looks like a legitimate house bill and the other looks like a legistlative briefing (http://urbanlegends.about.com/library/n_pa_cell_phone_ban.htm). If you do a quick Google or Live.com search, you’ll quickly find that this is a hoax (such as http://urbanlegends.about.com/library/bl_pa_cell_phone_ban.htm). In fact, there is no legislation currently in the PA State Legislation system that pertains to a cell phone ban.
I was struggling with an issue today when converting some C# to VB.NET. C# has a really cool “yield return” statement that is used in an iterator block to provide a value to the enumerator object. VB.NET does not have the “yield” keyword. So, there are a few solutions (none of which are really clean) to get around this. You could use a return statement to return the value if you are looping through and would like to break an enumerator and return a single value. However, if you’d like to return the entire enumeration, create a List() of the child type and return the list. Since you are usually using this with an IEnumerable, the List() will work nice.
Quite often, vendors pass images or PDFs to customers using the binary contents of the file. To make it more secure, they convert the binary contents to a Base64 string. A full explanation about Base64 encoding can be found at Wikipedia here. Anyway, when you receive the string, you cannot simply write it to a file or to the browser. First, you must convert the data into a Byte array. The sample code below demonstrates this:
Dim str As String = “Insert Your Base64 String Here”
Dim Base64Byte() As Byte = Convert.FromBase64String(str)
Then, you can decide which output method you’d prefer. If you’d like to write the content to the file system, you can write it as:
Dim obj As FileStream = File.Create(“C:\test.pdf”)
obj.Write(Base64Byte, 0, Base64Byte.Length)
If you’d prefer to write the content to the browser, you’d most likely add this to your page:
I’d highly recommend setting the content-disposition header attribute if you write the file to the browser. I’ve explained more about using this header at http://weblogs.asp.net/jgaylord/archive/2004/12/08/278309.aspx.
On Wednesday, Scott Guthrie announced that beginning with version 3.5 of the .NET Framework (and VS2008), the base class libraries will be browsable and can be used for debugging purposes.
On Tuesday I found out that I received the MVP award again. Congrats to all of the other new and renewed MVPs out there!
On Monday we invited a new member, David Barkol, to join the ASPInsiders. Our group is expanding and a few more developers will be added in the upcoming months.