We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

VB.Net to C# Conversion Help

Thread ID:

Created:

Updated:

Platform:

Replies:

12365 Mar 27,2004 03:30 AM UTC Mar 30,2004 11:52 AM UTC WinForms 1
loading
Tags: FAQ
Steve Graddy
Asked On March 27, 2004 03:30 AM UTC

I am having a problem converting one line of code in this VB.Net Function. I have marked the line below in its context. In the converted C# code I am getting a error stating "Input string was not in a correct format". Is there anyone out there that can shed some light on fixing this line.. I have included the entire function so that you may see the context. The VB.Net line is : lChar = CInt("&H" & Mid(sMD5, (lCount * 2) - 1, 2)) Mod 32 The Converted C# is : lChar = Convert.ToInt32("&H" + Strings.Mid(sMD5, (lCount * 2) - 1, 2)) % 32; Thanks for any help sent this way... Steve Graddy orgbrat@orgbrat.com

Steve Graddy
Replied On March 30, 2004 11:52 AM UTC

Just in case anyone was interested, here is the solution: lChar = Convert.ToInt32(Strings.Mid(sMD5, (lCount * 2) - 1, 2),16) %32; The key was adding the 16 format specifier. >I am having a problem converting one line of code in this VB.Net Function. >I have marked the line below in its context. In the converted C# code I am getting >a error stating "Input string was not in a correct format". Is there anyone out there >that can shed some light on fixing this line.. I have included the entire function so >that you may see the context. > >The VB.Net line is : lChar = CInt("&H" & Mid(sMD5, (lCount * 2) - 1, 2)) Mod 32 > >The Converted C# is : lChar = Convert.ToInt32("&H" + Strings.Mid(sMD5, (lCount * 2) - 1, 2)) % 32; > >Thanks for any help sent this way... > >Steve Graddy >orgbrat@orgbrat.com

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;