Click here to Skip to main content
15,900,511 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
See more:
So I created a class in C# but the project is in vb.net. I want to call a procedure that is inside that class called main() I have imported the class to the vb.net project but I can not figure out what I am doing wrong... Can anyone explain how I can do that in vb.net?
Here is some of the code in the the class I am using.. The name of the class is TagAPI.dll

C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using System.Net;
using System.Xml.Linq;
using System.IO;

namespace TagAPI
{
    public class Class1
    {
        //how this works...
        //folder names read by main application and shown in listbox
        //user selects and version gets saved in versionselect.txt
        //(this application)application reads versionselect.txt (-) and reads json and makes arguments and then create a new txt file and run the argument.
        //go back to main app.

          class atomMinecraft
    {
        internal static Dictionary<string, string[]> versionData = new Dictionary<string, string[]>
        {

.
.
.
}




        static void Main()
        {
            //Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData
            string text = System.IO.File.ReadAllText(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/.minecraft/TagCraftMC Files/Settings/versionselect.txt");

}



Can anyone tell me what I can add in my visual basic application to call the main procedure?
Posted
Comments
BillWoodruff 31-Dec-13 22:41pm    
fyi: there is a resource for (free) on-line conversion of C# to VB.NET:

http://www.developerfusion.com/tools/convert/csharp-to-vb

1 solution

Hi, I have fixed the issue by using
C#
public static void main()

And changing the name of the namespace (not sure why this was an issue...) anyway thanks :D
 
Share this answer
 
Comments
BillWoodruff 31-Dec-13 20:55pm    
Hi Ammar, I was about to post a reply to this message with several suggestions about preparing C# code to be used in VB.NET. If you wish, I will write the response, but, if you are happy with what you have now, that's great.

Happy New Year !
Ammar_Ahmad 4-Jan-14 8:11am    
Hi, sorry for the late reply... I would love to see your suggestions too :D
And btw happy new year :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900