Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Why can\'t I get this random number generating form to work? using System; using

ID: 3743798 • Letter: W

Question

Why can't I get this random number generating form to work?  

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 WindowsFormsApp3
{
public partial class Form1 : Form
{
Random Ran = new Random();
int value;

public Form1()
{
InitializeComponent();
}

private void Button1_Click(object sender, EventArgs e)
{
value = Ran.Next(1, 69);
label1.Text = value.ToString();

}
}
}

Explanation / Answer

For System.data:

Hi you have to add the .dll file of System.Data to your AssetsPlugins folder . To do so, go to your directory UnityEditorDataMonolibmono.0 and get the System.Data file and later add it to the folder mention before

.

For System.Drawing:

You need to add a reference to System.Drawing.dll.

This can be done as follows: In your Solution Explorer (Where all the files are shown with your project), right click the "References" folder and find System.Drawing on the .NET Tab.

For System.Windows.Form:

Expand the project in Solution Tree, right click on References, Add Reference, Select System.Windows.Forms on Framework tab.You need to add reference to some non-default assemblies sometimes

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote