Link to home
Start Free TrialLog in
Avatar of Rowel Virgo
Rowel VirgoFlag for Philippines

asked on

Convert C# to VB.NET

Thanks heres the source code link from google drive and this is video link from youtube.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace NamesGenerator
{
    public partial class Form1 : Form
    {
        string[] FirstNames = { "John", "Peter", "Jason", "Andrew", "Richard" };
        string[] LastNames = { "Lannister", "Targaryen", "Snow", "Stark", "Mormont", "Tarly", "Greyjoy" };
        Random rand = new Random();

        public Form1()
        {
            InitializeComponent();
        }

        private void btn_Generate_Click(object sender, EventArgs e)
        {
            int indexFirstName = rand.Next(FirstNames.Length);
            int indexLastName = rand.Next(LastNames.Length);

            this.txtbox_FirstName.Text = FirstNames[indexFirstName];
            this.txtbox_LastName.Text = LastNames[indexLastName];
        }
    }
}

Open in new window



using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace NamesGenerator
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rowel Virgo

ASKER

OK I will try this
site cannot convert it
Both runs fine. Which one you are facing issues with?
I have also given you the converted code.