Hi all,
I have created my project vb.net backend sqlserver 2000 . act i have done all process. now i want my setup works only available times. Example i need only 2 times.. mean my setup work only times .. how can i do.
Please help me ..
Advance thanks. to all
bala guruPosted Apr 18, 2008, 12:42 AM
Thanks friend ..
I want vb .net code .. pls help me
Niradhip ChakrabortyPosted Apr 17, 2008, 5:56 PM
Use this code in the starting page of your application. LogIn is the name of my starting page.
This code allow you to maximum twice to run the application after installing set up. You can change the number as per reqirement
protected
void Page_Load(object sender, EventArgs e){
private static bool m_blnRunning = false;
Find("Your process name");
if (m_blnRunning == true){
return;}
Application.Run(
new Login());}
}
private static void Find(string processName)
{
int intCount = 0;
try
{
foreach (Process thisproc in Process.GetProcessesByName(processName)){
intCount = intCount + 1;
if ((intCount == 3)){
m_blnRunning =
true;}
}
}
catch
(Exception ex){
throw new Exception(ex.Message);}
finally
{
}
}