|
Thanks
I figured that, since when you select Windows Credentials login to the SQL Server it never prompts you to use the credential settings.
|
|
|
|
|
hallo
how do I divide the computing of a selected program between two computers.
for example, i am using word though my computer computing half of the program.
can somebody help my?
thanks.
|
|
|
|
|
What you're refering to in your example is not clustering. The application has to be written to support what your talking about. You can't just open Word and expect two machines to run the same instance of the app. There is considerable low-level O/S and hardware support required to get something like this to work.
This is something that is FAR beyond the capabilities of the .NET Framework.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 15:16 Wednesday 1st February, 2006
|
|
|
|
|
Hi,
This is what I have which is assigned to a string variable. I would like to replace the \\ to \
How is this done please?
I tried:
string strData = strData.Replace("\\", @"\")
But it does not work.
Thanks
strData = "{\\rtf1\\ansi\\ansicpg1252\\uc1\\deff0{\\fonttbl\r\n{\\f0\\fswiss\\fcharset0\\fprq2 Arial;}\r\n{\\f1\\froman\\fcharset2\\fprq2 Symbol;}}\r\n{\\colortbl;\\red0\\green0\\blue0;\\red255\\green255\\blue255;}\r\n{\\stylesheet{\\s0\\itap0\\f0\\fs24 [Normal];}{\\*\\cs10\\additive Default Paragraph Font;}}\r\n{\\*\\generator TX_RTF32 12.0.500.501;}\r\n\\deftab1134\\paperw12240\\paperh15840\\margl1440\\margt1440\\margr1440\\margb1440\\pard\\itap0\\plain\\f0\\fs24 is is\\plain\\f0\\fs20 to \\plain\\f0\\fs20\\i confirm\\plain\\f0\\fs20\\par for \\plain\\f0\\fs20\\ul testing\\plain\\f0\\fs20\\b reasons...\\par }"
|
|
|
|
|
string strData = strData.Replace(@"\\", @"\")
or
string strData = strData.Replace("\\\\", "\\")
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
C# reads "\\" as one slash, so type "\\\\" instead
|
|
|
|
|
sorry, did not see other post - tired :S
|
|
|
|
|
I think that you should look at the real problem, not just the symptom.
Why do you have a string that contains double backslashes? Where does the string come from?
I see that you also have escape codes like \r and \n in the string. If you don't handle them first, you will end up with a string that contains some "\r" that means Carrege Return, and some that doesn't.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote:
Why do you have a string that contains double backslashes? Where does the string come from?
Looks like an RTF file header.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Yes, I recognise the rtf code, but that is not the point. Where does the string come from, as it contains escaped characters? If it would have been read from an rtf file, it woudln't.
---
b { font-weight: normal; }
|
|
|
|
|
Why does this matter? You can have a hardcoded rtf string somewhere to preset the contents of a RichTextBox for example, and the sample the original author gave here looks just like such a case.
Besides it seems to be perfectly good rtf, he just misinterpreted the escaped backslashes...
Regards,
mav
|
|
|
|
|
I agree.
What does it matter where the string came from?
He simply wanted to know how to fix the string by replacing the double backslashes with singles. Problem was solved.
-Jason
|
|
|
|
|
jasonpb wrote: What does it matter where the string came from?
He simply wanted to know how to fix the string by replacing the double backslashes with singles. Problem was solved.
As the string contains both escaped control characters and escaped backslashes, simply replacing the backslashes will not solve the whole problem.
It's not very uncommon that the real problem is different from what the original poster thinks. If you then only answer the question, you haven't solved the problem. Many times I have not only provided the correct answer, but also the correct question. Just because people don't know what to ask for, should we deprave them of a good answer?
---
b { font-weight: normal; }
|
|
|
|
|
mav.northwind wrote: Why does this matter? You can have a hardcoded rtf string somewhere to preset the contents of a RichTextBox for example, and the sample the original author gave here looks just like such a case.
If it were a hardcoded string, the obvious solution would of course be to correct the string in the code instead of correcting it afterwards.
mav.northwind wrote: Besides it seems to be perfectly good rtf, he just misinterpreted the escaped backslashes...
If it really was actual code that the original author showed, the problem does not exist at all, so the correct solution would be to do nothing at all.
What the best solution is, is still unknown until we know where the string comes from. That why I asked.
---
b { font-weight: normal; }
-- modified at 3:58 Thursday 2nd February, 2006
|
|
|
|
|
I think the simple explanation is that fmardani pasted something into his RTB and looked at the Rtf property in the VS debugger.
I guess that's what a lot of people do in the beginning to get into rtf.
That's exactly the format you get there (including the missing semicolon after his strData = ... assignment)
But you're right, the RTF string itself is not the real source for the author's problems but a general misunderstanding regarding escaped characters and the '@' notation.
Regards,
mav
|
|
|
|
|
I need to decompress some files from a UNIX system that has compressed them with COMPRESS in to <filename>.Z
I've checked SharpZipLib and GZIP does not work with this format (nor any other)
Anyone know of a C# (or VB.NET) library that can decompress this file type?
'Howard
|
|
|
|
|
I have come across an issue using the RichTextBox control and using hidden text.
I have programatically placed hidden text in the control and then attempt to search for that text using the Find method. The indexes it returns are correct.
However, when I call Select (or even set the SelectionStart and SelectionLength properties) to select some text that includes the hidden text this fails to work properly. The actual behavior is to reverse SelectionStart and SelectionLength.
For example:
this.textBox.SelectionStart = 45;
this.textBox.SelectionLength = 0;
-or-
this.textBox.Selection(45, 0);
Now look at the property values in the debuger and you will see SelectionStart = 0 and SelectionLength = 45.
If I remove hidden text from the control everything works fine.
Has anybody experienced this behavior? Just to be sure I wasn't messing with the values somewhere else, I commented out all other Selection calls and setting of the properties from my code and still had the issue.
Thanks
Eric
|
|
|
|
|
I have investigated further and noted the following behavior:
If I set the SelectionStart property to 45 it will stay at 45. However, when I set the SelectionLength property to say 0; then the problem arises.
So it seems you can set one of the properties and it will store properly but when you set the second one the "switch" occurs.
Thanks,
Eric
|
|
|
|
|
Even more strange behavior:
It seems that the Select method and setting of SelectionStart/SelectionLength will result in:
SelectionStart = SelectionStart + SelectionLength
and
SelectionLength = 0
This appears to be the case no matter what the values are and the settings will occur after both properties have been set.
Thanks,
Eric
|
|
|
|
|
Hi!
I have been working with hidden text in RichTextBoxes some time ago and couldn't find suspicious behaviour.
Since you didn't write how you insert hidden text and didn't give the exact RTF string, all I can say is that selection seemed to be consistent if you are aware that a RTB's Text property will contain the hidden text (although the RTB doesn't show it) and the values used for selection are relative to the contents of your Text property.
Regards,
mav
|
|
|
|
|
I insert the Rtf string as follows at the current position of selection.
textBox.SelectedRtf = "{\rtf1\ansi\v " + text + "\v0}"
I also am aware that the Text property will have the hidden text in it. The Find method returns the correct index. The problem occurs when I try to move the selection to the location returned by Find and set the length of selected text.
Please let me know if the above insertion is not valid.
Thanks for your help,
Eric
|
|
|
|
|
I just tried it.
Created a RTB and then wrote:
richTextBox1.Text = "test";
richTextBox1.Select(2,0);
string text = "hidden";
richTextBox1.SelectedRtf = @"{\rtf1\ansi\v " + text + @"\v0}";
richTextBox1.Select(0,0); The RTB showed just "test", the cursor was at the beginning of the line, as expected.
Then I tried to select something via code:
richTextBox1.Select(1,8); and, like I expected, the RTB selected "es" inside "test".
That's what I meant in my previous posting: richTextBox1.Text is "tehiddenst" and selection has to occurr according to this string. In my sample the selection goes from the first 'e' (index 1) 8 characters to the right ('ehiddens'). Since the hidden part isn't shown, only 2 characters are shown as selected, even though 8 characters actually are selected.
Regards,
mav
|
|
|
|
|
Thanks for clearing this up.
I won't be able to try this out until later.
I'll let you know if I'm successful.
Thanks
Eric
|
|
|
|
|
Ok, thanks again for the input.
I have looked at what is going on and still believe I'm doing things right (probably wrong since it doesn't work, but oh well!).
I created a little test app to do what you did and was able to create the issue I'm having. If you don't mind please try:
Create an form with richTextBox1 and button1 objects.
Use the code below:
private void button1_Click(object sender, EventArgs e)<br />
{<br />
int index = this.richTextBox1.Find("hidden2",<br />
RichTextBoxFinds.MatchCase | RichTextBoxFinds.NoHighlight);<br />
this.richTextBox1.Select(0, index);<br />
int temp = this.richTextBox1.SelectionStart;<br />
int temp2 = this.richTextBox1.SelectionLength;<br />
this.richTextBox1.SelectedText = "Eric";<br />
}<br />
<br />
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
this.richTextBox1.SelectedRtf = @"{\rtf1\ansi te\v hidden1\v0st1\par}";<br />
this.richTextBox1.SelectedRtf = @"{\rtf1\ansi te\v hidden2\v0st2\par}";<br />
}<br />
Now if you run the app with the first two lines of SelectedRtf statements (basically like your example) and run the app the selection process in the button click method works well; the resulting text in the RTB is: "Ericst2".
Now if you use the other two lines of SelectedRtf statemsnt (basically what I'm doing) you will find the Select doesn't work. And behaves like I mentioned and the RTB shows: "test1Erictest2." Note the SelectionStart and SelectionLength properties don't match what was sent to Select.
Thanks,
Eric
|
|
|
|
|
Ok, now I think I see what the problem is.
The RTB seems to have a problem when the RTF starts with hidden text.
I doubt that the behaviour is created by the .NET wrapper around the underlying rich edit control, but you can try to reproduce the same effect with an MFC program, for example, to verify this.
Then you should try to contact Microsoft and let them know that there's a problem with the rich edit control, they might even be able to fix it easily and produce a hotfix.
Some time ago I had a different problem with the RTB (the undo/redo buffer was cleared when you queried its Text property) and received a new version of the rich edit control that didn't show the behaviour.
Altogether, I'm very content with the performance of Microsoft's support, so you should give it a try.
Regards,
mav
|
|
|
|