16,005,038 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 12386982 (Top 10 by date)
Member 12386982
15-Feb-20 2:16am
View
Plz help...
Member 12386982
14-Feb-20 3:24am
View
i dont know how to do.. i googled alot..
Member 12386982
13-Feb-20 22:36pm
View
how should i do that.
Member 12386982
13-Feb-20 5:25am
View
once you have installed my application, it will run automatically when you on your PC. and will automatically run after a particular interval of time and update an xml file (updating the current time).
https://drive.google.com/file/d/1XCyYkLf7pwb-mIb3WIAoT0t9cU6tYwGL/view?usp=sharing
the link contain my application
Member 12386982
13-Feb-20 5:01am
View
now i want to run the application automatically.. plz help..
Member 12386982
13-Feb-20 4:58am
View
i changed the code of form like below.. so the control enter into the class..
public Form1()
{
reg.SetValue("DBTool", Application.ExecutablePath.ToString());
InitializeComponent();
Thread splashthread = new Thread(new ThreadStart(objBackup.backup));
splashthread.IsBackground = true;
splashthread.Start();
try
{
//objBackup.IPAddress();
System.Timers.Timer BackUpTimer = new System.Timers.Timer();
BackUpTimer.Interval = Convert.ToInt32(2000 * 60 );
BackUpTimer.Elapsed += new System.Timers.ElapsedEventHandler(MyTimer_Elapsed);
BackUpTimer.Start();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Member 12386982
13-Feb-20 4:28am
View
my problem is the control is not even entering into backup class while first time running. which i mentioned
Thread splashthread = new Thread(new ThreadStart(objBackup.backup));
Member 12386982
13-Feb-20 4:25am
View
sir, i want to run my application automatically after a particular time intervals like 2 minutes. and edit an xml file with current time. so i used a thread and a timer. i have created a form and a class ( backup.cs ).
//Code of Form
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;
using System.Threading;
using Microsoft.Win32;
namespace AutoBackup
{
public partial class Form1 : Form
{
Backup objBackup = new Backup();
NotifyIcon notifyIcon = new NotifyIcon();
RegistryKey reg = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce", true);
public Form1()
{
reg.SetValue("DBTool", Application.ExecutablePath.ToString());
InitializeComponent();
Thread splashthread = new Thread(new ThreadStart(objBackup.backup));
splashthread.IsBackground = true;
try
{
//objBackup.IPAddress();
System.Timers.Timer BackUpTimer = new System.Timers.Timer();
BackUpTimer.Interval = Convert.ToInt32(2000 * 60 );
BackUpTimer.Elapsed += new System.Timers.ElapsedEventHandler(MyTimer_Elapsed);
BackUpTimer.Start();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void MyTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
objBackup.backup();
}
}
}
//Code of Backup Class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Xml;
namespace AutoBackup
{
public class Backup
{
string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
public void backup()
{
using (XmlWriter writer = XmlWriter.Create(path+"\\BackupDetails.xml"))
{
writer.WriteStartElement("Backups");
writer.WriteElementString("Time", DateTime.Now.ToString());
writer.WriteEndElement();
writer.Flush();
}
}
}
}
Member 12386982
13-Feb-20 4:08am
View
sir...the control is not entering into backup class.. for editing the xml file... i want automatic editing.. plz help
Member 12386982
13-Feb-20 2:22am
View
not working
Show More