|
Thanks for ur reply,
I have tried the TextWriterTraceListener class to write the trace msgs into a file, will there be any locking problem if multiple dlls or exe try to write into a file at the same time??
i tried with 3 threads writing at the same time it seems to be like all the message from 3 thread getting mixed and written into the file??
is it correct to use tracelistners for event logging ?? since our event log file is very important we used it in the manufacturing station?? so there should not be any missing data..
Any other way to do this..
Thanks in Advance
Srini
|
|
|
|
|
engsrini wrote: there be any locking problem if multiple dlls or exe try to write into a file at the same time??
From my recollection, the textwriter uses stream in the base and flushes the stream as needed. So you're not always opening and closing the file everytime to write something to trace. From my past experience, I did not run into this problem.
Is the fvent logging is for debugging purpose? if so, do not pollute the System Event (App.) Log. The Event Log does have a limit on the size and throws you a nasty exception if the rate at which you're inserting the new entries is greater than the rate at which it can process deletion of old entries. And the worse part is that there is no information in the Exception which points you to the actual source of the problem.
- Malhar
|
|
|
|
|
Hello,
If the user2 is logged in onto the machine, and trying to log into a SQL Server that using Windows-Credentials Logon, can the user2 impersonate user1's credentials to log into SQL Server? Assuming that user1 has windows logon.
Thank you
Help will be greatly appreciated.
|
|
|
|
|
That sounds pretty illegal to me, so i doubt MS put functions specifically in .NET to flaw their own security..
What exactly do you need it for?
|
|
|
|
|
I just want to have one account that would be able to access SQL Server. Application that is run by numerous users (Which will not have access to SQL Server) will pull the user information from lets say Windows Registry and use that information to access SQL Server.
Thank you
|
|
|
|
|
Why not create a SQL logon and only allow them access to the database that you want.
We have a config file that resides in the same path as the app that tells us who they should logon as, the database, and the SQL server name.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
I really did not want to use the Mixed mode to log into SQL Server. But integrated Security.
Thank you
|
|
|
|
|
Integrated Security doesn't support login's like you want. It only supports using the Windows Identity established on the O/S thread when you logged into Windows. You can't use alternate credentials with Integrated Security.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
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
|
|
|
|