in my application i have notice that i have approximately 30 global variables. is it bad programming and batter way is to pass to variable using the function or it doesn't matter ?
this is the list of all my globat variables from public partial class MainWin : Form
private const int WM_SYSCOMMAND = 0x112;
private const int SC_CONTEXTHELP = 0xf180;
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp);
NetworkAdapter selectedAdapter = null;
string lastPath = "";
int _selectedIndex;
bool bContinuePlay;
bool ifContinue = true;
decimal delay = 10;
int delayBetweenLoops;
ManualResetEvent manualResetEvent = new ManualResetEvent(false);
BackgroundWorker backGroundWorker = null;
bool isBurst = true;
IpV4Address oldIpAddress;
IpV4Address newIpAddress;
ushort oldPort;
ushort newPort;
MacAddress oldMacAddress;
MacAddress newMacAddress;
bool fixBadChecksum = false;
bool removePPPOE = false;
bool removeVlan = false;
bool fragmentation = false;
private DateTime lastCheck = DateTime.MinValue;
bool continuePlay = true;
RangeFinder range = null;
IpV4Address oldRangeIp;
IPAddress newRangeIpStart;
int loopsCount;
decimal numberOfLoops;
double playSpeed;
string path = "";
bool isError = false;