ExtremeFitness
asked on
Convert C# to VB.Net
Can any one show me what this looks like in VB.NET
[Serializable]
public class MyObject : ISerializable
{
public int n1;
public int n2;
public String str;
public MyObject()
{
}
protected MyObject(SerializationInfo info, StreamingContext context)
{
n1 = info.GetInt32("i");
n2 = info.GetInt32("j");
str = info.GetString("k");
}
[SecurityPermissionAttribu te(Securit yAction.De mand,Seria lizationFo rmatter
=true)]
public virtual void GetObjectData(Serializatio nInfo info, StreamingContext context)
{
info.AddValue("i", n1);
info.AddValue("j", n2);
info.AddValue("k", str);
}
}
[Serializable]
public class MyObject : ISerializable
{
public int n1;
public int n2;
public String str;
public MyObject()
{
}
protected MyObject(SerializationInfo
{
n1 = info.GetInt32("i");
n2 = info.GetInt32("j");
str = info.GetString("k");
}
[SecurityPermissionAttribu
=true)]
public virtual void GetObjectData(Serializatio
{
info.AddValue("i", n1);
info.AddValue("j", n2);
info.AddValue("k", str);
}
}
Hi,
the previous comment is the right answer to your question.
But if you want to convert code quickly, you can try this web site :
http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx
The result is not always accurate, but it does almost the right conversion for you.
Hope it helps
Patrice
the previous comment is the right answer to your question.
But if you want to convert code quickly, you can try this web site :
http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx
The result is not always accurate, but it does almost the right conversion for you.
Hope it helps
Patrice
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<Serializable()> _
Public Class MyObject
Implements ISerializable
Public n1 As Integer
Public n2 As Integer
Public str As String
Public Sub New()
End Sub
Protected Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)
n1 = info.GetInt32("i")
n2 = info.GetInt32("j")
str = info.GetString("k")
End Sub
<SecurityPermission(Securi
Public Overridable Sub GetObjectData(ByVal info As System.Runtime.Serializati
info.AddValue("i", n1)
info.AddValue("j", n2)
info.AddValue("k", str)
End Sub
End Class