|
Lot of ways...
(*) You can have a shortcut to the application in the Users->Startup folder in STart Menu or (AllUsers -> Startup folder, to affect all users. I think for the latter you need to have Administrative Privileges on the system).
(*) You can have a entry in HKLM->Sofware->Microsoft->Windows->CurrentVersion->Run
(*) You can configure your application as a Windows Service itself. Developing a Windows Service in C# and deploying them is a breeze. A lot of samples anyway.
I think the first two are logon based. Some user should logon for the app to launch. The latter, by virtue of being a Windows Service, would start immediately on system boot.
Vasudevan Deepak Kumar
Personal Web: http://www.lavanyadeepak.tk/
I Blog At: http://deepak.blogdrive.com/
|
|
|
|
|
thanks for the immediate response. when i will develop a windows service, is it possible to have a method from the service that will call a c# windows app to run? i need this because i need to generate message prompts to the users in the network... i know with the other two methods, i can do this, but im not sure if it can be done using windows service and another c# app. tnx
|
|
|
|
|
I think you can run an application from a service, but usually the service will not have the right to interact with the desktop, so expect your WindowsForms application to crash as soon as it tries to open a window.
Regards,
mav
|
|
|
|
|
What about the autoexec.bat file
|
|
|
|
|
You mean placing a call to a .NET application inside autoexec.bat?
One word: Don't.
The solutions given so far are about the only options you have available. First you have to decide whether you want your program to run when the system is started (then use a service) or if you want it to run when a user logs in (then you can use the other two methods).
But nevertheless, for a windows service to run nobody has to be logged on so you usually don't have a desktop to perform user interaction with.
You _can_ allow a service desktop interaction, though.
But allowing this is usually considered bad style.
Regards,
mav
|
|
|
|
|
|
You can also try to
- use Win.ini (from good Win 3.11 times)
- write a Windows Explorer extension that starts your application
- replace a process used by the system with a modified version. On XP, you need to disable system restore for this.
- find more strange autostart locations
|
|
|
|
|
Daniel Grunwald wrote: - replace a process used by the system with a modified version. On XP, you need to disable system restore for this.
This solution will break on 64 bit windows. To stymie rootkit authors it'll no longer be possible to replace/modify OS runtime files without convincing MS you can't do it any otehr way and getting them to digitally sign your files.
|
|
|
|
|
if i remember well, if u add your program to program files/startup, it will start once with windows...
|
|
|
|
|
Noooooo, it will start when the user logs in, not when Windows starts. There is a HUGE difference.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
yup, u'r right... my mistake... if u want, u can mess with the boot section and make it be a win service that starts when windows starts...
|
|
|
|
|
hi!!!!!!!!
good day to all of you.....
as i'll make my project proposal in the internet connection, i have a problem in the timer in the MFC it has an error, coz i dont even know the code in the timer button.....
thanks ........i hope u will help me on this.........
regards
|
|
|
|
|
You won't get much help with this. Your question doesn't make any sense what-so-ever.
Internet connection? Timer? MFC? Button?
How does any of this relate to each other and what is it you're trying to do? What's the error?
MFC is a Visual C++ thing, not compatible with C#, so I hope you're even in the correct forum!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have used the eventlogger to log the events in system's application log. what is the path for that file, is it possible to specify the path for application log. how could i do auto/manual archieve on the application log
please help..
Regards,
Srini
|
|
|
|
|
I thing ... the path is specified in the registry
File=%SystemRoot%\system32\config\AppEvent.Evt
but i want to store log file in a specified path without touching registry (ie without registry class in c#)
but still iam struggling with how to archieve the application log (i.e copying the file to normal text file)??
Regards,
Srini
|
|
|
|
|
For example.. lets say you wanted to back up the System event log..
C:\WINDOWS\system32\config\SysEvent.Evt
Good luck trying to read it though, the evt files are encoded
Then there is
C:\WINDOWS\system32\config\System.Log
But you probably wont be able to open because Windows will have a tight grip on it.
My suggestion is this...
Open up your server explorer in Visual Studio and find the log you want to use. Click and drag that log over to your form or component.
It will have an event that gets fired whenever something writes to it, and will send that message to that event. So you could start achiving that way, or you could just periodically read the logs.
-Jason
|
|
|
|
|
Thanks jasonpb,
Yah ur correct it is provide some events like
eventLog1.EntryWritten
But unfortunately it doesn't help me to programatically archive the event log data . ie it doesn't have method like to store the event log data into some other file. i thing we have to look for some win32 API to that is it correct??
i.e i have a menu Log -> Archive Event log
if the user press the above menu i have to store the event log file content to some other text file..
|
|
|
|
|
I have a chat app that use a webcam. I am taking a screenshot of the preview window in order to get the image. Only problem is, if the window is hidden or say minimized, my images come back as big Black square..ughh
Anyone know how to get the window to keep painting itself when its hidden or minimized?
Any help would be appreciated.
Thanks
-Jason
|
|
|
|
|
Hi,
This might have something with the IIS/permissions to do - but I'm not sure.
My web application worked just fine (developed with VS2003) but then I installed VS2005. I have this code that loads an assembly
Assembly asm = Assembly.Load("CustomLibrary");
which succeeds. The assembly is loaded just fine. Then I try to retrieve a class from the assembly:
Type customization = asm.GetType("CustomLibrary.Customization");
but this returns null.
If I run the exact same code on my laptop (on which I haven't gotten around to install VS2005 yet - thank god... ) it still works. So all that has changed is that I've installed VS2005. I still open the project in VS2003, run it from VS2003 and the IIS is set to use framework 1.1.
What can have happened ? Is it somehow being executed from the 2.0 framework ? Has the default security settings suddenly changed on my local IIS during the install ?
Any help will be much appreciated. Thanks in advance !
/Jan
Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert
|
|
|
|
|
Hi
I am using VS2005 Beta2. Can I set the grid header colour in the form designer and/or programmatically?
E.g. : dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = ...
Thanks
|
|
|
|
|
Hey howzit?
I would like to beable to move a textbox that is on my form with my cursor to anywhere on the form in run-time?
Is this possible, could you perhaps give me a code snippet? I am very new to C#!
Thanks!
|
|
|
|
|
Yes it is possible and easy too.
Try to play around with "Location" property of your control
e.g
in MouseMove event try to do following
Textbox1.Location = new point(Textbox1.Location.X+/*mouse X cordinate*/,Textbox1.Location.Y+/*mouse Y cordinate*/);
I hope it helps!
|
|
|
|
|
Hello friends
I have a layered window (WS_EX_LAYERED) and I want to put some controls on it without faking and redrawing the entire Bitmap of the form.Please help me if there is a way to implement this.
[ _ Always there is another way _ ]
|
|
|
|
|
Hi all,
I am very new to DirectoryServices. I created an ActiveDirectory user by using DirectoryServices. I can find that added entry later-on aswell. But I still couldnt figure out that how can I delete an added user later.
I tried
DirectoryEntries.remove("username", DirectoryEntry.SchemalClassName);
as mentioned on MSDN, but its keep on givng me an error like:
Invalid DN name assigned. I think I have to get the GUID for user I want to delete but I have no idea how can I get the GUID for any user e.g. "testuser" in Active Directory
Can anybody help me?
btw, if this is not the right place to ask this question where should I ask this question?
Thanks in Advance!!!!
|
|
|
|
|
Hello! i'm rather new to C# and i'd like to ask you if you know how i can send any parameters to the "cmd".For example, if you press start->run and you tipe: cmd /k "ping ip_adress -t -l x_bytes" ... then it starts comand prompt and pinging an adress. The question is how do i send the parameters to the function? I've succeded in opening the cmd process with System.Debug.Process.Start("cmd"); but i don't know how to send parameters.
Awaiting your answer...
Thank u!
|
|
|
|