Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

This code was converted from VB6 to VB.NET 2005:

   Public Function ConvertBytesToMBString(ByVal BytesDouble As Double) As String
       On Error Resume Next
       ConvertBytesToMBString = VB6.Format(BytesDouble / 1048576, "#########0.#0 MB")
   End Function

I don't want to use Microoft.VisualBasic.Compatibility in my application!

My question is that what is 100% .NET version of this code?

VB6.Format(BytesDouble / 1048576, "#########0.#0 MB")

Any idea?

Posted

Also if you need to use an error catch, use the

Try
'Your code
Catch ex as exception
'handle error

Live as if you were to die tomorrow. Learn as if you were to live forever.
Gandhi

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...