|
Thanks. I thought I had checked that. It turned out to be the Upgrade GUID that was identical. Once I had the IDE generate a new one, it worked just fine.
--HamCoder
|
|
|
|
|
Hi,
I am trying to update a Windows Service as follows:
* the service uses the Updater Application Block to check for updates to itself.
* if updates are found the service should launch a console application and then stop itself
* the console application will download the updated files and copy them to the right location and then restart the service
My problem is that the service is not launching the console application correctly. The application is visible in the Task Manager but not on the taskbar. The application doesn't do anything that it's supposed to.
I know that the code for the console application works fine because it works perfectly if I run it myself of if I launch it from a Windows Forms application.
Is there anything different when starting a process from a service?
The code I use is as follows:
<br />
Dim p As New Process<br />
p.StartInfo.WindowStyle = ProcessWindowStyle.Normal<br />
p.StartInfo.FileName = Path.Combine(My.Application.Info.DirectoryPath, "Utilities\UpdateUtility.exe")<br />
p.StartInfo.Arguments = My.Application.Info.AssemblyName<br />
p.Start()<br />
Me.Stop()<br />
Thanks very much,
dhartigan
|
|
|
|
|
Hello
You must allow your service to interact with the desktop.
If you go to the properties of the service on the LogOn Tab you
must check that item.
Hope it helps
|
|
|
|
|
you'll need to allow the service to interact with desktop
How terrible is wisdom when it brings no profit to the wise
|
|
|
|
|
I'm trying to find file/folder owners using VB 2005 and .NET 2.0. I've been successful using the System.Management namespace and WMI calls, but this takes a lot more coding than it looks like it would take using .NET 2.0. I've found the following C++ example at http://msdn.microsoft.com/msdnmag/issues/06/00/SecurityBriefs:
void printTheOwnerOfThisFile(string path) {
FileSecurity s = File.GetAccessControl(path);
NTAccount user = (NTAccount)s.GetOwner(typeof(NTAccount));
Console.WriteLine(user);
}
...
printTheOwnerOfThisFile(@"c:\autoexec.bat");
Here's my attempt at translating it to VB 2005:
Imports System.IO
Imports System.Security.AccessControl
Imports System.Security.Principal
Module Module1
Sub Main()
Dim FilePath As String = "c:\autoexec.bat"
Dim s As FileSecurity = File.GetAccessControl(FilePath)
Dim user As NTAccount = s.GetOwner(NTAccount)
Console.WriteLine(user)
For i As Int64 = 1 To 100000000000
i = i + 1
Next
End Sub
End Module
(The For-Next loop is just to keep the console window open long enough to see what was written.) I'm getting a Build error on the GetOwner parameter in parentheses that "NTAccount is a type and cannot be used as an expression." However, the GetOwner method parameter is supposed to be "targetType as System.Type" according to MSDN.
Can anyone tell me what I'm doing wrong? Is it just not possible to get the file owner in VB using .NET 2.0?
Thanks in Advance
|
|
|
|
|
is251rd wrote: Dim user As NTAccount = s.GetOwner(NTAccount)
Change that to
Dim user As NTAccount = s.GetOwner(GetType(NTAccount)) is251rd wrote: The For-Next loop is just to keep the console window open long enough to see what was written.
Have you tried Console.ReadLine() ? That'll keep the window open until you hit enter
Cheers,
Will H
|
|
|
|
|
Thanks a bunch, Will! That works great! I've been combing the internet for a couple days trying to figure this out.
|
|
|
|
|
Scenario
You've just started a new semester and you've become friends with one of your classmates, Tomislav. Tomislav tells you he has just moved to the United States from Europe and he's having a difficult time adjusting to the English units of measurement. In his country, most liquids are measured in liters, not gallons.
Tomislav tells you that he's been having an especially hard time buying gasoline, since he doesn't have much of an idea how much a gallon is. He also mentions he's having a tough time understanding how much is in a pint.
Since you got an 'A' in your last Visual Basic .NET course, you volunteer to write Tomislav an application to convert liters into pints and gallons.
Project Details
Create an appropriate user interface.
Include a Reset button, which will clear the interface controls.
Be sure to center the form on the screen.
Create a button that the user will click to complete the conversion.
Provide an appropriate title for your application window.
Create necessary labels for all fields.
Display the pint and gallon conversions in TextBox controls that cannot be edited.
Include comments in your application
Write code to complete the conversion.
Use the Internet or other resources to find out the conversion rates between liters and pints, as well as liters and gallons.
Deliverable Details
Please submit your assignment.
Submit only ONE file. The file should be a zip of ALL the files in the project folders.
Tips for Unit 1 IP (ITP330)
General
Use the VS2003 online help to find answers.
Here is a tutorial (from Microsoft) that will help you get started programming in VB.NET fast:
Setting Up the Visual Basic .NET Project
For the IP
Note the conversion is from wet liters to wet pints and from wet liters to wet gallons.
Textbox1: liters, for input
Textbox2: pints, read only for output
Textbox3: gallons, read only for output
Labels for the above textboxes
Compute button: btnCompute
Reset button: btnReset
Code the following methods: btnCompute_Click() and btnReset_Click()
Also can someone explain the differences between Object-Oriented Programming (OOP) and Object-Oriented Design (OOD). Can you also provide examples of how each can be applied in real life.
Can someone help me understand this stuff above. I really don't know how to write codes and if there is a website/tutorial out they somewhere that is built for beginners please let me know.
Thanks,
mcb12
|
|
|
|
|
Take a class and actually do the work assigned instead of asking for someone to do it for you.
|
|
|
|
|
To be fear, he actually didn't ask for someone to do the work for him, just to help him understand the assignment. That request is far too vague, though. If he really doesn't understand anything at all of the assignment, he is far behind...
---
b { font-weight: normal; }
|
|
|
|
|
What is is that you don't undsertand? It seems very clear to me.
The material refers to a tutorial, have you looked at that?
---
b { font-weight: normal; }
|
|
|
|
|
Post you question to "devX" forum. The people there are not rude and they will try to help you. I would try to help you but I'm still learning myself.
|
|
|
|
|
It has nothing to do with being rude, and everything to do with educating people that they need to do their own homework in order to understand - and ultimately pass - their class at college/school.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
|
With respect, if you don't understand this assignment question then you really are too far behind the eight ball for us to help you here.
However, there is a great book called VB.NET for Dummies. THIS DOES NOT IMPLY THAT YOU ARE DUMB. This book is one of the 'dummies' series for raw beginners in all subjects. It is clear and well written and I think you'll get a lot more out of it than calling for help on a forum such as this.
You can find it on Amazon.com[^]
BTW: I do not have any vested interest in Amazon.com or the book.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
I doubt you'll answer this but i'll ask anyway.
Generally, when you take a class in anything they teach you a certain amount before setting you any assignments. Have you just not attended any classes and got this assignment from somebody that has?
I only ask because you wrote:
mcb12 wrote: I really don't know how to write codes
How does somebody who has taken a class that teaches coding practice not know ANYTHING about how to "write codes"?
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
I really don't think anyone is trying to be rude answering your questions. What I've found is that almost everyone that is willing to answer questions on this or any other forum like Code Project, expects the person asking the questions to have put some effort into opening Visual Studio and setting up a form, etc.
Once you've started the application and get stuck trying to code a specific textbox or other control, ask.
Nobody is going to code your project for you, but there are many knowledgable individuals who will help with different parts of the project you have questions on.
As far as resources for learning, why not start with Microsoft's own Visual Studio site:
http://msdn.microsoft.com/vstudio/[^]
Lost in the vast sea of .NET
|
|
|
|
|
Hello. I want to validate a range of number like when you print in Word, "1,2,3-5,6,10-12". Any of you know the regular expression to do that.
Thanks a lot !!
|
|
|
|
|
What exactly would you like to validate? That the string entered is in the X-Y formatt?
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
You could use something like:
\d+(-\d+)?(,\d+(-\d+)?)*
That will still only validate the format, not the sanity of the range. A string like "45-3,12-14,13,13,0,0,0,0" would still be valid.
---
b { font-weight: normal; }
|
|
|
|
|
|
I have commented out some code but when I run my app the commented code is still throwing an error.
The error that I get is "Object reference not set to an instance of an object."
I get this same error when the code is uncommented. My app stops at the commented code with the error.
anyone any ideas.
Thanks.
|
|
|
|
|
compile the supposed commented code.
|
|
|
|
|
|
I have drawn an undee chart on a panel dynamically.I use a scrollbar.it is used to read fore chart.And what i want to get help is:
what do you think the best way to achieve it.
ICQ:258-235-734
-- modified at 4:32 Thursday 11th May, 2006
|
|
|
|