|
str.Replace(".", "." + Environment.NewLine);
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
string mystring= "This.is.a.test";<br />
string[] splitedData= mystring.Split('.');<br />
string result= "";<br />
<br />
for (int i = 0; i <= splitedData.Length-1; i++)<br />
{<br />
result= result+ splitedData[i].ToString() + "\n";<br />
}
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
|
|
|
|
|
You never want to hardcode the "\n" in .NET any longer. Use Environment.NewLine.
|
|
|
|
|
|
Hello,
edboe wrote: Use Environment.NewLine
good info!
Is there also a function for "\r\n"?
Thanks for youre help.
Martin
|
|
|
|
|
Martin# wrote: Is there also a function for "\r\n"?
There is. It's called Environment.NewLine .
MSDN topic of Environment.NewLine Property[^] states that the property value is "A string containing "\r\n" for non-Unix platforms, or a string containing "\n" for Unix platforms."
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Stefan Troschütz wrote: There is. It's called Environment.NewLine ;)
again and again
Thank you Stefan!
Maybe next time I do a little researche.
Martin
|
|
|
|
|
Hi.
Does anyone know haw exactly does the Windows OnScreenKeyboard work?
To be more specific, I'm interested in how it simulates the actual keystrokes (not like SendKeys.SendWait(), SnedMessage() or PostMessage() work, but like you're really working with the keyboard).
Another thing of interest is how it never takes the focus when you click the keys?
I've tried to simulate it using SendKeys,SendMessage or PostMessage, but I always need to transfer the focus back on the receiving form, which is obviously not a good approach.
Can anyone give me a hint?
|
|
|
|
|
Hello,
I have created a CustomEventLog. I am using the EventLogInstaller class and using Installutil.exe to install my log. However I notice that the MyCustomLog.Evt file is not being generated?
Does anyone know how the .Evt file gets generated?
Thanks so much for the help.
RB
|
|
|
|
|
I don't know about using Installutil.exe to install an event log, but I do know that when you create an Event Source using EventLog.CreateEventSource(), the event log will be created automatically if it doesn't exist already.
if (!EventLog.SourceExists("SourceName"))
EventLog.CreateEventSource("SourceName", "LogName");
will create an event log for you named LogName.evt (it will be in the \System32\config directory) with a Source of SourceName .
To write to it:
EventLog myLog = new EventLog("LogName",".","SourceName");
myLog.WriteEntry("Loggin my event...");
Documentation:
EventLog.CreateEventSource Method (String, String) [^]
This method can also create a new custom log on the local computer.
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Thank you.. I have been doing it this way as well. I just did not see my new LogName.evt showing up in my \System32\config directory. However I restarted my system and the file appeared. Go figure.
Thank you.
RB
|
|
|
|
|
Hello...
Does anybody has this bug also ?
If you open a file in VS2005 (File | Open - File), then just select a directory with a lot of icons.
Then you can see, the icons for the files are wrong. It should be : ICON[i] = FILES[i-2].
But in OpenFileDialog is ok.
|
|
|
|
|
I do no experience it. How many icon files do you have?
Alexandru Ghiondea
MCP
|
|
|
|
|
Bug? In Microsoft Software? No way!!!
That one I have not seen.
|
|
|
|
|
i read the book of " Schaum’s outline series , THEORY AND PROBLEMS OF DATA STRUCTURES" BY SEYMOUR LIPSCHUTZ.
it is a cool book but in it’s programming problems he want program like in ch5
can any one help tell me if i can make it by c#
or how can i find the answers of this problems
thanks lot
|
|
|
|
|
amirafouad21 wrote: he want program like in ch5
This makes no sense.
amirafouad21 wrote: can any one help tell me if i can make it by c#
You can do pretty much any programming problem in C#.
amirafouad21 wrote: how can i find the answers of this problems
Sounds like you are asking for homework answers. This is a no-no. Also, please title your posts more appropriately rather than just using 'help.'
____________________________________________________
If at first you don't succeed, skydiving might not be for you.
|
|
|
|
|
leckey wrote: amirafouad21 wrote:
he want program like in ch5
This makes no sense.
I think he assumes we have mind reading abilities to know what is ch5
leckey wrote: Sounds like you are asking for homework answers. This is a no-no. Also, please title your posts more appropriately rather than just using 'help.'
I agree. I just love 'help' threads
If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa
|
|
|
|
|
You can rewrite the question like this:
I have a homework assignment. I noticed a similar example in another language in chapter 5 of this book.... Can you rewrite the example for me in C#, so I can hand it in.
|
|
|
|
|
very thank for your advice edboe , all you write is right and this is the problem can u help me edboe.
the question in liked list in data structure, the problem is that i want an algorithm or code in c# for this case that say write a program which reads an integer K and prints the list of clients of lawyer K and test the program for each K.
i know there is a pointer in c# but how i can make it.
thx a lot
|
|
|
|
|
Could anyone tell me how I could replace the system tray clock? I have seen a lot of applications do that, like ChameleonClock, and would like to do one myself. If somebody could give me some clues on doing that, I would really, really really appreciate it.
Thanks
-----
Vandra Akos
|
|
|
|
|
I looked into doing that about a year ago. From what I remember, it required jumping through some very complicated hoops to get it done. I think you had to get the window handle of the system tray, then the handle of the clock window, take over the message pump of that window and intercept certain messages for painting. Your code essentially replaces the drawing code of the original clock... I think!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Nah, I don't really think it would be *THAT* complicated. I saw a I guy did something like this, but had a problem somewhere else, and said "I replaced the system clock, / that was simple /, but then got into some trouble..."
So I think there should be a simpler solution to this.
-----
Vandra Akos
|
|
|
|
|
No, not really. There is no seperate Clock.exe or service putting that clock up. It's built into Explorer.exe, so I seriously doubt he "just replaced it".
He more than likely wrote his own clock and put that up in the system tray.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
So, do you have some code snippets, or anything to start with, because i couldn't really understand what you said before thoroughly...
Anyhow sounds very nasty, and i wonder if it was possible for a process to draw into another process' area... If it was, that could be a huge security flaw in windows... I mean i could go on, and change any window's contents...
-----
Vandra Akos
|
|
|
|
|
Vandra Akos wrote: So, do you have some code snippets, or anything to start with
Nope. Just a few hours of Googling taught me what needed to be done, including finding the correct window handle, processing of the messages, and code injection into another process.
Vandra Akos wrote: i wonder if it was possible for a process to draw into another process' area
Yes it is. All you need in the handle to the window you want to draw in. Keeping it drawn the way you want and not having the application overdraw what you've done is the hard part.
Vandra Akos wrote: If it was, that could be a huge security flaw in windows... I mean i could go on, and change any window's contents...
Not easily, but it could be done. It's not as big a problem as you might think, though. There are security restrictions on some of the Win32 functions that you have to call to pull this off. If your a normal User, then you can't make some of the calls required to do this. If your an Administrator though...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|