|
A service is unlikely to be the right tool.
What is the goal?
|
|
|
|
|
the goal is that : I need the service to update a Data Base or read from it before the user log on his windows account , and then when he log on the service opens an application for him,
if the service is unlikely to be the right tool , what else can be ?
is there a way to run an application before the user log on windows, then it continues run ?
There is always something to learn
|
|
|
|
|
Just make it two seperate parts...a service that updates the database, and an application that has a shortcut in the "startup" folder so it starts automatically on login. If you need to, you can have the application notify the service when it closes, that way it will know know the user logs off as well. But, like I said, you can't have the service open an application directly, because it is running on the "system" account.
|
|
|
|
|
A Service would be running continuously whether a user is logged in or not, is that what you want?
You may want to use a Scheduled Task that executes when the user logs in.
To have an app run when the user logs in, use the Startup folder, but first be sure the user wants it to.
|
|
|
|
|
hii,
Im developing an client server application in C#.
In that i have to use Mobile Agent technology.
On the Server side there is a class...which i want send to the client...by System.IO class..let the class be Mobile...and it has a methode mobilecode()
public class Mobile()
{
public void mobilecode()
{
Code for gathering data from client.
}
}
On the Client side i read this file by stream reader...and i save this class in the same directory of the client.cs project..
on main function of client.cs
i call the class by...
Mobile.mobilecode();
but while compiling..it gives the error...
Mobile doesnt exist...
even if i make an empty class Mobile...thinking it could b overwritten by the code sent from server...dat does not happen...on runtime it reads the same old file...and not the does not updates till the code is executed.
So can anyone help me ou here...as to how to send a class file 4m server to client at runtime and access it immediately at runtime...!!
any help wud b appreciated...
Thnx in advance,,,,!!
|
|
|
|
|
You can't do that - the compiled program is exactly that - compiled. You can't just copy a .cs file beside the .exe file and expect it to read the .cs file.
Client-Server communication is usually handled in a completely different manner then what you are trying to do. You can look at this for a starting point:
http://www.codeproject.com/KB/IP/BasicTcpServer.aspx[^]
Exchanging actual class source code between client and server applications would require using dynamic compilation and reflection, which is probably way beyond the scope of what you are trying to do.
|
|
|
|
|
hey..
thx 4 d info..
thn is it possible to implement mobile agents in C#?..if yes how?
|
|
|
|
|
That depends on the complexity of the mobile agent you are creating.
If you need it to execute arbitrary code, then you will need to use dynamic compilation/reflection.
If you can replicate the entire program at each station and you only need to move its current state, then just copy over a configuration file instead of a .cs file, which allow the next station to load itself into the previous stations state and continue.
|
|
|
|
|
Hi my names Joe,
Im a newbie and I need to find out the best way to let a user be able to retrieve a list of files from a database, then obviously add a new path to a file.
The files are pdf, i need to know which control would be best to use to retrieve info from a database and then be able to edit and brwose to a directory and select a new file to be added. this info in turn will be terieved by our intranet which will display the pdf.
Donno if anyone might want to help.
Thanks
J
|
|
|
|
|
KornJoe wrote: then obviously add a new path to a file.
Not sure what this means ? Add a path to what file ?
KornJoe wrote: i need to know which control would be best to use to retrieve info from a database
No control should be used to do this, you should write code to get data from your database.
KornJoe wrote: then be able to edit and brwose to a directory
If you want a list of items to edit, a datagrid or grid view is fine. IF you want to browse for folders, you can use a FolderBrowseDialog to do this, and get back the folder path.
KornJoe wrote: this info in turn will be terieved by our intranet which will display the pdf.
If you want to change the contents of PDFs, you will need to use a third party library. No PDF support is built in.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hii,
i am developing a client server application in C#..
In this multiple clients can connect 2 server. I am using a set of 4 servers so that the fault tolerance can be increased in case a server is down..its load can be shared by another server i.e. i am developing a distributed application.
now i want to know how these client requests can be distributed across the set of servers.
i mean suppose i want server should handle 25 clients at max...
if 26th client tries 2 connect to it it should redirect the clients to the another server whch is available...and if all servers are busy then display a message all servers busy..
so can u give me the code as to how load balancing can be done among multiple servers.
any help would be appreciated.thanks in advance
ankita luniya
|
|
|
|
|
I would expect you'd set up communication from the server that users connect to, to the other servers, and they would keep track of how many connections there are, so that you can distribute them as you go, so it's 2/2/2/2, not 8/0/0/0. Also, I wouldn't expect you to create an arbitrary cutoff, who is to say if 26/26/26/26 would not work just fine ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
yaa...d arbitrary cut off thing is ok...26 ws jus an example...can u exemplify wht u saud wid an example....??
|
|
|
|
|
Hi,
Is it Possible to use RMI(Java Concept) like concept in .Net?
If Yes-How can we used?
If No-Then other solution for that will be?
Thanks
|
|
|
|
|
|
I'd like to drag metafile from my C# application and drop it in Word, Excel or Visio.
Metafile metafile = new Metafile("meta.emf"); <br />
DataObject data = new DataObject(DataFormats.EnhancedMetafile, metafile); <br />
DoDragDrop(data, DragDropEffects.Move);
I found, that .NET uses new format of the clipboard so older applications cant recognize the dragged .NET metafile.
In this article http://support.microsoft.com/kb/323530[^] is a guide to copy the .NET metafile to the clipboard, so I can paste it later to Word.
But how can I DragDrop this metafile directly to Word ?
|
|
|
|
|
Hey All,
I need help with this urgently, and any would be much appreciated...
I have a CAB file that gets downloaded from a site to a pocket pc or smartphone...
I need to have data attached to it somehow, just a line of text or something, either
in some seperate file or somehow...
This is because I need to have a changing "serial code" to go out with each download of the CAB...
Thanx a million in advance!
|
|
|
|
|
There are libraries that can open cab files, but another solution is to generate your license codes seperately and design your app so each code is verified online and only works on one machine.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanx alot for you advice and swift reply Christian!
you rock...
Seems like these would be the only ways, could you direct
me to any of these libraries? and I hope the lib wouldnt
require me to rebuild my application... thanx again!
|
|
|
|
|
Hi, how can verify if in my computer is installed / available a printer?
Can help me with example?
Thanks a lot.
Alex
modified on Tuesday, March 18, 2008 5:41 AM
|
|
|
|
|
Hi
in the System.Drawing.Printing there's a class called PrinterSettings . This class contains a static Property called InstalledPrinters which holds the names of all installed printers.
greets
M@u
|
|
|
|
|
Thanks! I try this ..
Alex
|
|
|
|
|
Hi,
i registered my own url protocol, something like: test://
But on each click on url it opens new instace of application.
Any idea how to handle all clicked urls in one application instance?
Greetings
|
|
|
|
|
Hi all,
I have write a program for showing added records, couter. but it does not working/showing during the for loop execution. after stoped loop it will show. but i want to show it as continue (1,2,3 ... 50000).
for (intCounter = 1; intCounter;= 50000; intCounter++)<br />
{<br />
lblShowCount.Text = intCounter.ToString();<br />
<br />
oEmployee.AddRecord();<br />
}
Please guide me what would be the better approch for showing continue Counter during the loop execution
Pavan Pareta
|
|
|
|
|
this will do....
for (intCounter = 1; intCounter;= 50000; intCounter++)<br />
{<br />
lblShowCount.Text = intCounter.ToString();<br />
Application.DoEvents();<br />
oEmployee.AddRecord();<br />
}
KSS
|
|
|
|