อมร อุ่นจิตต์วรรธนะ

watcher.changed += new filesystemeventhandler(addressof watcher_changedcreationtime) ====>> addhandler watcher.changed, new filesystemeventhandler(addressof watcher_changedcreationtime)

I'm tried convert from C# to vb.net
Link: http://www.codeproject.com/Articles/58740/FileSystemWatcher-Pure-Chaos-Part-of

in file Watcher.cs

VB.NET (VS2013, .NET4.0) C# to vb.net error is:

watcher.changed += new filesystemeventhandler(addressof watcher_changedcreationtime)

VB.NET (VS2013, .NET4.0) correct is:

addhandler watcher.changed, new filesystemeventhandler(addressof watcher_changedcreationtime)
Problem by อมร อุ่นจิตต์วรรธนะ Status: Not Done Comments: 0 Last update: 2015-09-17T05:58:02 by อมร อุ่นจิตต์วรรธนะ
0
El Capitan

-- line 1 col 1: eof expected

when converting VB to c#I am getting error
-- line 1 col 1: EOF expected
Feedback by El Capitan Status: Not Done Comments: 3 Last update: 2015-08-31T11:12:42 by Howard Woods
1
Dolf Meijer

Error converting VB AND / OR operators to C#

When converting a VB IF-THEN statement, sometimes the conditional AND and OR operators are converted to '&' and '|' respectively. These are bit-operators, not boolean operators. Expecially when the exact type cannot be determined, the bit opertors are favoured over the move obvious '&&' and ||' boolean operators.
Example:
VB:
If x.boolField And y.Length > 1 Then
' do something
End If
C#:
if (x.boolField & y.Length > 1) {
// do something
}
Problem by Dolf Meijer Status: Not Done Comments: 0 Last update: 2015-07-30T10:50:58 by Dolf Meijer
0
M Roberts

vbNullString

vbNullString doesn't get translated to null
Problem by M Roberts Status: Not Done Comments: 0 Last update: 2015-07-16T18:27:30 by M Roberts
0
Darkie Doom

Use of array conversion VB.net -> C#

Hey please correct this issue:
When I convert a code from vb.net to c#.net, the converter won't convert the usage of arrays corretly:
vb: messagebox(mystrarray(0))
the convertet text: messagebox.show(mystrarray(0))
But the right conversation would be:
messagebox.show(mystrarray[0])
Thank you :)
Feature Request by Darkie Doom Status: Not Done Comments: 0 Last update: 2015-06-27T19:49:01 by Darkie Doom
0
Tim Hittesdorf

Structure to struct

Public Structure Oid
Public Shared Property RuntimeMac As String = "1.3.6.1.4.1.12394.1.1.1.10.0"
Public Shared Property UnitMac As String = "1.3.6.1.4.1.12394.1.1.1.8.0"
End Structure

gets converted to

public struct Oid
{
public static string RuntimeMac { get; set; }
public static string UnitMac { get; set; }
}

instead of

public struct Oid
{
public const string
RuntimeMac = "1.3.6.1.4.1.12394.1.1.1.10.0",
UnitMac = "1.3.6.1.4.1.12394.1.1.1.8.0";
}
Feedback by Tim Hittesdorf Status: Not Done Comments: 0 Last update: 2015-06-19T14:25:46 by Tim Hittesdorf
0
Neil Clarke

array length in array initialiser is different from C# to VB.NET

object[] namevalues = new object[2 * parms.Length]; in C#

Converts to:

Dim namevalues As Object() = New Object(2 * parms.Length - 1) {} in VB.NET

Note the -1 in the array length
Problem by Neil Clarke Status: Not Done Comments: 1 Last update: 2015-06-08T16:18:49 by Neil Clarke
0
Sam Lewis

Incorrect conversion for implemented interfaces

The c# to vb converter does not add the "Implements Interface.Mehod" after the implemented method for example:
When implementing IXmlSerializable the "Implements IXmlSerializable.GetSchema" was not added after the "Public Sub ReadXml(reader As System.Xml.XmlReader)"
Problem by Sam Lewis Status: Not Done Comments: 0 Last update: 2015-06-08T15:03:33 by Sam Lewis
0
Nicholas De La Haye

Bug no number truncation from C# to VB .net

Tried to convert some code from C# to VB .net using your online converter but it translated the code wrong and does truncate the number down.

It tried to translate this C# code:-
return (int)(Sample()*maxValue);

And turned into this VB code:-
Return CInt(Sample() * maxValue)

The problem is the CInt function in VB does not truncate a number down, so if you had a value of 9.98 the CInt function would will return 10. But the C# cast of (int) only rounds down so should return 9 not 10. CInt is mainly used to convert text to a number. You need to use Floor or Fix functions to address this issue.

Please can you fix this bug?
Problem by Nicholas De La Haye Status: Not Done Comments: 0 Last update: 2015-05-30T19:43:31 by Nicholas De La Haye
0
Dmitry Barsukov

Bug in conversion of For cycle

C# original:
List<string> values = new List<string>(value.Split(' '));
// Filter empty
for (int i = 0; i < values.Count; ++i)
if (values[i].Trim().Length == 0)
{
values.RemoveAt(i);
--i;
}

VB.NET conversion:
Dim values As New List(Of String)(value.Split(" "C))
' Filter empty
For i As Integer = 0 To values.Count - 1
If values(i).Trim().Length = 0 Then
values.RemoveAt(i)
i -= 1
End If
Next
----------------------------------------
This is not correct: VB.NET does not check values.Count on every iteration. That why conversion is not correct
Problem by Dmitry Barsukov Status: Not Done Comments: 0 Last update: 2015-05-11T12:58:10 by Dmitry Barsukov
0
Displaying items 31 - 40 of 76