|
No, I have not run it under network service account. I run it under local system account, which should have unrestricted access anyway.
CreateFile -- it is just a test program that illustrates the problem. The real service uses SerialPort class and behaves the same.
|
|
|
|
|
abshmak wrote: unrestricted access anyway
But not to network resources.
abshmak wrote: SerialPort class and behaves the same.
The serial port class give you a "File not found exception" also?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Wes Aday wrote: The serial port class give you a "File not found exception" also?
Yep, when run as a service or a scheduled task under an account that has local admin access.
Thanks
|
|
|
|
|
There are some strange differences between an interactive session and a service with the same user account. Last week, I had to find out that the environment variable %appdata% need not get resolved for the service.
Also look for batch files which are executed when a user logs in interactively.
|
|
|
|
|
Yep, i know. it is a non interactive service and has all the settings configured properly. It would be coming with a diff error anyway.
|
|
|
|
|
I see a problem. In the second parameter to CreateFile, you're not specifying any access rights.
You're supposed to request
GENERIC_READ | GENERIC_WRITE
Or in numbers:
0x80000000L | 0x40000000L
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I was going to try it, even though i did not think it would be an issue, as it should have behaved the same regardless of the account/mode it is run under. But then uncovered the solution.
|
|
|
|
|
Hi Guys,
I found the solution to my particlar issue, so posting it here in case it might help someone one day.
I am using an RS232 to USB cable. Supposedly it uses Prolific chipset.
Originally i installed the drivers supplied by the manufacturer. While trying to troubleshoot i installed the oficial prolific drivers which did not work, so i had to revert back to the initial drivers.
But, once this has been done, the things started to work:
- i no longer needed to run the program as elevated
- when run as a service the program is able to access the port
I suspect that this is some sort of a fault in the install package provided by the manufacturer, but i am going to leave it at that.
Regards,
Alexei
|
|
|
|
|
I am writing a C# 2010 console application that will have between 10 to 30 ways on how to run the application. The ways to run the application depends upon the parameter values that are supplied to the application. There a few ways to run the console application were the steps need to be completed successfully before the next step is executed.
I am trying to determine the best way to setup this application. Should I have the program determine how it should run by:
1. passing values to console application that will be run in the main method?
2. Should I use a database table that will be read to determine the way the program shoulld be executed on a particular run?
3. Is there an option using a windows service and/or scheduler?
4. Do you have any other options that will work?
Basically can you tell me what method you think would be the best and why? In adition can you tell me and/or point me to a reference that I can use to code your method of choice?
|
|
|
|
|
The easiest and most common way of doing this is to pass parameters to the program which are checked and validated in the main() method.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I have a C# 2010 console application that I am thinking of passing the parameter values to the application in the
applicationSettings><namspace.properties.settings> of the
consoleApp.exe.config file. I am thinking of using this option instead of passing argument values to the application.
What kind of code would I need to setup if I use this option? Would I look for args.length? Can you tell me what kind of code I would need to setup?
|
|
|
|
|
See here[^]. However this would be somewhat more complicated than my later suggestion.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi Everybody,
Last month I published a simulator solution for sending and receiving messages by C# on my laptop and made accedent and all my work lost, I tried to decompile my Simulator.exe file but get not sorted project and have many proplems, and can't modify it and it takes along time to redevelop it again
Is there a solution to decompile it as fast as possible ?
Best Wishes
|
|
|
|
|
Sounds like you have already decompiled it. Try a different decompiler and see if that gives you a better result.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
You're not going to get a full solution to build without errors, no matter what you use. MSIL is NOT a direct represnetation of the full source of your application, only an optimized approximation of it.
|
|
|
|
|
There is a program called reflector that is perhaps what you are looking for.
It is not free though.
|
|
|
|
|
See if you can find a debug/unoptimised version of your program. That way the IL will be the closest to the source code. However, you can never retrieve the exact source code from a compiled output. That's why source control and backups are important.
|
|
|
|
|
|
I'd certainly give Telerik's free JustDecompile tool a try [^] if you have not already tried that.
They are upgrading this tool regularly: [^].
I have no connection to Telerik, and, so far, have only used their free tools, which I appreciate.
good luck, Bill
"Takuan Sōhō died in Edo (present-day Tokyo) in December of 1645. At the moment before his death, Takuan painted the Chinese character 'meng' ("dream"), laid down his brush and died."
|
|
|
|
|
I want to have a program that have just one form. there must be some button in left. with clicking eache button the right side of form must change and have button specific labels and textboxes. I'm new in c# so I don't know what this called?
if there is a specific tools for this job or should I subclass something to create that?
|
|
|
|
|
There is nothing special in what you describe so it not called anything special. It's simply a form that you create.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
There are many types of UI implementation, using a single Form, that you could use here.
If you describe the purpose of this application more specifically, I think you can get more specific advice on which UI type might be be best.
1. do the UI buttons on the left side, always remain fixed, and always have the same title (display text) and function ?
2. when you select one of the possible right-side UI's required: does the amount of horizontal, or vertical space on the Form need to change in order to show all the required controls. That leads to:
3. can the single Form change in Size, or must it remain fixed in size ?
4. finally: can we assume that the varying contents on the right side are going to be a set of facilities, each one with its own unique controls and/or content ?
I will assume in this response you are working in Windows Forms.
For example, here's one idea:
1. You might consider using a SplitContainer control on your form, where the left buttons go on its left panel, and depending on the choice in the left panel, the right panel contents change. A SplitContainer gives you the option to expand the size of the right panel, if it requires more, or less, horizontal space.
The big questions here, to me, are: what are the "units of whatever" that appear on the right side, and do they ever effect what appears on the left side ?
Be happy to respond in more detail if you'll provide more detail here.
best, Bill
<color>"When it comes to atoms, language can be used only as in poetry. The poet, too, is not nearly so concerned with describing facts as with creating images." Niels Bohr
|
|
|
|
|
I create a C# solution using VS2010, containing many projects. I would like to cancel all unneeded files (1. to make the solution lighter as I want to send it using mail, 2. to delete my personal data) . I used Build->CleanSolution, but I note It didn't delete file like .vshost and . manifest, and also files in obj\x86\Debug, so I should do it manually. I there a way to delete them manually (is it useful to delete them for the two goals I have)
Thank for your time
|
|
|
|
|
Take a look at the article[^] and see if that meets your needs.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Hi All, I understand that usually when you need to pass data from a method to another method the the method doing the sending has to be some other type than void. Having said that, is there anyway I can get data from the PageLoad method which is of type void? Thanks in advance.
|
|
|
|