|
Thank You for your answer
Tried it but that did change anything either.
Guess I'll have to give my program permission to set values in the registry
Regards
Rick
|
|
|
|
|
You don't give your "program" permissions to the registry. Your application runs as YOU, or the person or ID that launched it. If you don't have permissions to change that value, you have to use a higher level user account, like an Admin account.
If you're running the code under a normal user account, just about the entire HKEY_LOCAL_MACHINE hive is off-limits. If you're code is not just swallowing the exceptions, your code should have thrown an Access Denied error, or something very similar.
|
|
|
|
|
Thank You for your reply,
Got it figured out. just one of those rookie mistakes.
your origional solution was right on the mark.
worked just fine once I got my head around it.
Regards
Rick
|
|
|
|
|
Is there a way to iterate through a string of text and find each occurence of a string that contains a substring of "{" + (variable string) + "}" and replace it with a corresponding string defined in a dictionary (of which the key value is the "{" + (variable string) + "}" ??
|
|
|
|
|
string OldStr = "Application";
string NewStr = "Program";
string str = @"Run the Application , Close the Application and Delete the Application";
str = str.Replace(OldStr, NewStr);
I know nothing , I know nothing ...
|
|
|
|
|
Thanks.. I used that in a loop and put all the key values as the string to be replaced
|
|
|
|
|
Yes.
I suppose you'll want a hint as to how!
If the string is formatted such that { and } only occur as a wrapper to a variable name then the easiest way I can think of is to run a regex on it, match all "\{[^\}]\}" and iterate through them.
If not you'll probably have to write a lexer of some kind.
10110011001111101010101000001000001101001010001010100000100000101000001000111100010110001011001011
|
|
|
|
|
This is a good solution too, thx
|
|
|
|
|
Given that you have the text in the text variable and the replacements in the replacements dictionary:
text = RegEx.Replace(text, @"\{(.+?)\}", m => replacements[m.Value]);
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Can anyone see what I'm doing wrong here?
All I want to do is generate a password with htpasswd.exe and it looked
easy enough but it just gets stuck at ReadLine()
ProcessStartInfo ps = new ProcessStartInfo();
ps.FileName = Path.Combine(Application.StartupPath, "htpasswd.exe");
ps.Arguments = "-n test";
ps.CreateNoWindow = true;
ps.UseShellExecute = false;
ps.RedirectStandardInput = true;
ps.RedirectStandardOutput = true;
ps.RedirectStandardError = true;
Process proc = new Process();
proc.StartInfo = ps;
proc.Start();
proc.StandardInput.WriteLine("testing");
proc.StandardInput.WriteLine("testing");
string line = proc.StandardOutput.ReadLine();
proc.Close();
|
|
|
|
|
I know nothing about 'htpasswd', but generally a ReadLine() method expects a carriage return. Did you hit return?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
The WriteLine adds a carriage return so that part is ok.
I found what I had missed, the command-prompt needed to
exit before it returned the result.
So adding this before reading the output solved it:
proc.StandardInput.WriteLine("exit");
|
|
|
|
|
|
True it generates a sort of md5 hashed passwords, but htpasswd.exe is a part of
Apache webserver and they use a modified version of md5.
|
|
|
|
|
Hi,
My question has two parts:
1) How can I search for a sentence (e.g., Dell Canada) in a string (e.g., I am working in Dell Canada, and I found it...) .
2)The second part is my string is text in a RichTextBox, so I would like to find the TextRange of that selected sentence and apply certain decoration.
thanks.
|
|
|
|
|
+++ AUTOREPLY #17 +++
What have you tried so far?
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
1) use the IndexOf function for the string...
int startPos = richTextBox.Text.IndexOf("Dell Canada");
2) use SelectionStart and SelectionLength properties of the rich text box the use properties such as SelectionColor, SelectionFont etc. (not tested)...
richTextBox.SelectionStart = startPos;
richTextBox.SelectionLength = "Dell Canada".Length;
richTextBox.SelectionColor = Color.Red;
Easy!... when someone does it for you
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi,
How does one go about, catching the events of a USB card reader...
Currently, when I open notepad and swipe a card, the information on the card is printed automatically in plain text.(Windows installed standard drivers).
How do I go about obtaining the data event, where the data is written? How can I obtain the data written via a simple C# application.
Does anyone understand my question. If vague, plz ask.
Any help or starting point (documentation) would be much appreciated.
Kinds regards,
Higs
|
|
|
|
|
Look here[^].
Enjoy
I are troll
|
|
|
|
|
What the hell are you smoking?? FileSystemWatcher to deal with a keyboard-based card reader??
|
|
|
|
|
Currently, when I open notepad and swipe a card, the information on the card is printed automatically in plain text.(Windows installed standard drivers).
He can access the data as if it were a file. I didn't see a reference to the keyboard-based interface
Dave Kreskowiak wrote: What the hell are you smoking??
Usually, or just right now?
I are troll
|
|
|
|
|
Eddy Vluggen wrote: Currently, when I open notepad and swipe a card, the information on the card is printed automatically in plain text.(Windows installed standard drivers).
He can access the data as if it were a file.
Really? What file?? These things don't write to files. Neither do barcode scanners, laser scanners, or anything else. Since these devices do not know anything about file systems or Windows or UNIX or Linux or MacOS, there's really no way for them to write to files.
Eddy Vluggen wrote: I didn't see a reference to the keyboard-based interface
The only way anything can show up in Note like he described is if the device worked like a keyboard.
|
|
|
|
|
Goodmorning.
Yes, you are right
I are troll
|
|
|
|
|
Most card readers / scanners operate as a keyboard simply typing the read information onto the control / window that has focus.
Check the API of your card reader, surely the vendor released some information.
|
|
|
|
|
Thank you very much .... I suppose I will abuse the fact that it works like a keyboard... with the same events, etc. This fact works well for me !
Thanks for your help !
|
|
|
|