|
Try using something like this[^].
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
You can use the built-in Package class for this.
|
|
|
|
|
Hi,
I'm trying to access all the services in a remote server, the ObjectQuery "Select * from Win32_Service" is not displaying the user created services, is there any other query needed to retrieve this info, please advice me,
Thanks,
D.Vinoth
|
|
|
|
|
Does this only happen if you execute this query on a remote server or does it even happen if
you do this query on your local machine?
If I execute your query local, it shows me also the user created services.
Greetings
Covean
|
|
|
|
|
Hi Covean,
Thanks for the reply. It is working fine in my local system, the problem is with server only...
any idea on this...
Thanks,
D.Vinoth
|
|
|
|
|
Found something on MSDN maybe that helps (but I think you already have this right):
"A user connecting from a remote computer must have the SC_MANAGER_CONNECT privilege enabled to be able to enumerate this class. For more information, see Service Security and Access Rights. "
If I remember your last posts, you connect to the remote machine by some useraccount thats valid on this machine. Is it possible to login with this useraccount local on the remote machine?
If so, I would try to execute the query there local and see if, it differs from the one you get by remote query. If it doesn't differ, I would assume that your user account needs more privileges.
Greetings
Covean
|
|
|
|
|
Hi,
How do i get the current quarter and year?
i.e. Q12010
Thanks
|
|
|
|
|
Hi,
DateTime.Today returns today's date.
ToString() will format it in one of many ways, however quarters are not supported.
You can calculate them yourself, as (Month+2)/3
FYI: I summarized some general information in this article[^], I will add some examples about weeks and quarters later on.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Luc Pattyn wrote: You can calculate them yourself, as (Month+2)/3
You do like to be abtuse, sometimes: (Month / 4) + 1 works as well, and is a little more obvious that it is Quarters rather than Thirds?
I am allowed to be stupid on Fridays - it's in my contract!
Just don't listen to me today, my brain is just not responding...
[edit]I am an idiot![/edit]
All those who believe in psycho kinesis, raise my hand.
modified on Friday, January 22, 2010 9:52 AM
|
|
|
|
|
Huh?
Where I live, there are four quarters in a year (as in most everything else), so each quarter holds three months. That means the divisor has to be three, not four.
Month 1 2 3 4 5 6 7 8 9 10 11 12
(Month+2)/3 1 1 1 2 2 2 3 3 3 4 4 4
(Month/4)+1 1 1 1 2 2 2 2 3 3 3 3 4
! ! !
[ADDED]
((Month-1)/3)+1 would be fine too, however I always prefer the other form, as it looks better (for me at least), and it is somewhat safer, with an outer operator of higher precedence so you can subtract it from something without needing extra parentheses; that is somewhat similar to inverse order tests such as if (null==variable)... , which I don't use!
[/ADDED]
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
modified on Friday, January 22, 2010 12:49 PM
|
|
|
|
|
pwnd.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Had to look that up!
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Oops! Sorry about that - corrected.
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
OriginalGriff wrote: I am an idiot!
IMO you're quite OK, well, most of the time.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
DateTime.Now has properties that give you the current month and year. You'll have to figure out the quarter yourself but it's a simple
DateTime now = DateTime.Now;
if (now.Month < 4)
{
}
else if (now.Month < 7)
{
}
else . . .
EDIT: I need to refresh my browser more often
|
|
|
|
|
I have created two form,When I Open form1 and then close it then open Form2 and close it.After that reopen form1 then Label field text is getting removed in form1.
Thanx in Adv.
|
|
|
|
|
Check the Form1_load event code also unload event if the label text is clearing?
|
|
|
|
|
Hi all
I want to parse a sentence like:father(X,Y):-parant(X,Y),male(X).and some other sentences that the structure of these sentences are the same but they have variable length.
I want to save each segment of these sentences in a Datatable.
What is your idea about segmentation of these sentences?(I'm using text.Split, Do you have better suggestion?)
If i use split methode i must use it in several times.
Maybe you have better suggestion that i can use it easier?!
modified on Friday, January 22, 2010 3:14 AM
|
|
|
|
|
Why have you got to use it several times?
I assume it's because you need to break it differently depending on the delimiters - so you know it is X because it is preseeded by "(", followed by "," and the name is in front?
If so, then why not use a Regex? Shouldn't be too complex if your sentances are all of the form A(B,C) (E,F),G(H)
A Regex could split that into named groups pretty easily.
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
Thx for your reply;
I want parse this sentence and some other sentence like this to these segment:
sentence : grandparant(X,Z):-parant(X,Y),parant(Y,Z).
segment : father X Y parant X Y parant Y Z
(variable X,Y,Z,.. must be upercase)
what is the best way?
Note:I think that if i want to use Regex , i must searh some particular expression but i want to parse any expression like above.
modified on Friday, January 22, 2010 4:59 AM
|
|
|
|
|
A regex is probably the easy way:
(?<Parent>(?<PName>\w+)\((?<PX>.+),(?<PZ>.+)\)):-(?<Children>.*)
This does not do the complete job: It breaks it into "Parent" which consists of "PName" and "PX" and "PZ", and "Children" which is everything else. It is pretty simple to expand to break the children down as well, but I don't have the time to do everything for you! Get a copy of Expresso[^]which will help you understand what is going on - it's free and really works well.
Then all you have to do is slide that into your C# and it should do the parse for you!
After that, a bit of validation, and you are away.
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
i am having mesh of a man ...
i want to make that mesh to walk based on mouse click of the mouse..
thank's
|
|
|
|
|
You are welcome!
|
|
|
|
|
The table (Password) has only 1 column (Password1) and only 1 row. It is also the PrimaryKey.
I can retrieve the password:
thePassword =
from tt in MainMenu.db.Password
select tt;
try
{
password = thePassword.ElementAt(0).Password1;
...
I am trying to change the value.
if ((from tt in MainMenu.db.Password
select tt).Count() > 0)
{
Password zz = MainMenu.db.Password.Single();
zz.Password1 = newPassword;
try
{
MainMenu.db.SubmitChanges();
}
...
I get the runtime error "A member defining the identity of the object cannot be changed ..."
|
|
|
|
|
as a practice, password column shouldn't be the primary key because you may want to change it later. Also, more than one users can have the same password.
Usually username could be used as a key or simply adding a new id.
Nigel Mackay wrote: I get the runtime error "A member defining the identity of the object cannot be changed ..."
Looks like that you are trying to change the password => primary key..
|
|
|
|