|
won't the break point hit twice because you are changing the text in the OnTextChanged handler, causing the TextChanged event to fire again?
|
|
|
|
|
Correct...
But why is it stopping there?
With this logic, it means that more calls to OnTextChanged() would be made... Right?
|
|
|
|
|
Only if you're making changes to what's stored in the .Text property. If you reset the .Text property with a string that's exactly like the one it already has, the event won't fire again because nothing's changed.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I see...
So the comparison the control is doing is not case sensative than, because what I'm doing is making upper<->lower string changes...
Thanks,
Shy.
|
|
|
|
|
No, unless you specify otherwise, a string compare is case-sensitive. The point is, if the user enters 'a', and you change it to 'A', you will not change it to 'A' again because it is already 'A'. Therefore, the handler will be called only twice.
|
|
|
|
|
I would like to put a C# project of mine under configuration control. I'm wondering, what actually needs to go in there for the project to be usable in the future.
Say i have ProjectX.
There is a ProjectX folder, with a ProjectX.sln and a ProjectX.suo in there.
Then ProjectX/ProjectX has all of my class files.
And then there is ProjectX/ProjectX/Properies
And then ProjectX/ProjectX/bin
What is actually necessary to keep, or is all if it necessary?
Any tips on a better way to organize it?
Thanks in advance!
|
|
|
|
|
Hi,
I have a web app that is not running altogether as well as it should, due to the rather large UI demands made of it. AJAX, components and .NET just isn't cutting it for my users.
So, I am thinking of porting it into a Windows app, which will run fast, sit on top of the same back end and look a whole lot nicer thanks to Teleriks WinForms controls.
The only downside is, we have a workflow system that issues messages, with links to get directly to records. eg:
http://mis.xxx.com/intranet/editProduct?p=1234
WHat I am looking to do is replace these links with something similar, eg.
myMis://editProduct/product/1234
The format of the request is not so important. What is is how can I configure the application to "listen" to requests starting myMis://? Much like ftp:// and http:// is listened to by IE/Firefox.
Many thanks
Nathan
|
|
|
|
|
You could expose the underlying methods as WebServices instead and consume them from your windows app... Certainly easier than writing a custom protocol handler...
Ciao
=============================
I'm a developer, he's a developer, she's a developer, Wouldn'tcha like to be a developer too?
|
|
|
|
|
The meat of the application is already a web service. The client is simply that, a client. The magic for the users would be when they can click ona link, my app is loaded and the link is actioned.
I take it it is tricky, then?
|
|
|
|
|
Hello everyone,
I am working on an Windows Apllication in c# and my faith has brought me face to face with Web Services. I have been searching the web and so far have been OVERLOADED with lots of information such as:
SOAP, HTTP, WSDL, UDDI, XML, PEAR::SOAP, NuSOAP, php-SOAP, etc.
I was wondering if anyone can point me to a simple step by step tutorial to create one which uses php to import few data into the Windows Application?
Thank you very much.
Khoramdin
|
|
|
|
|
Hi,
There is a folder on the network (FolderMain) that gets populated with .xml files.
It is not known at what time of the day the folder gets populated with files. But it does happen every now and then. i.e. every few days or once a day, etc...
What is the best way in .net 2.0 or sql server 2005 to monitor if there are any files in that folder on the network. I am thinking of using FileSystemWatcher in .net 2.0
So that as soon as a file is added to the folder it can be processed.
Thanks
|
|
|
|
|
arkiboys wrote: Re: monitor folder
You could have a SQL Jobs which will look the folder on scheduled times.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Could you direct me to a sample code please?
|
|
|
|
|
How to get the count of lines in .txt file.
Help.
C#
|
|
|
|
|
I'm not sure if you can do anything but brute force it. Here's one way:
// Read the file into a byte array
FileStream fs = File.Open("TextFile1.txt", FileMode.Open);
byte[] bytes = new byte[fs.Length];
fs.Read(bytes, 0, (int)fs.Length);
// int to store num of lines
int numOfLines = 0;
// if the file is not empty, we have at least 1 line
if (bytes.Length > 0) numOfLines++;
// increment the count for each newline character found
foreach (byte b in bytes) if(b == '\n') numOfLines ++;
...
This is just a starting point and would need to be more robust depending on the requirements. If the textfile's length is greater than int.MaxValue I suppose you'd need to read the file in sections. This solution will count all lines (even blank lines and trailing blank lines).
I would be interested to see another solution. I'm sure there must be a better one.
Cheers,
Ian
|
|
|
|
|
I would personally prefer to use StreamReader, it certainly looks more elegant.
int lineCount = 0;
using (System.IO.StreamReader sr = new System.IO.StreamReader("myFile.txt"))
{
while ( sr.ReadLine() != null) lineCount++;
}
Console.WriteLine( "Line Count: " + lineCount.ToString() );
Obviously you should add some error checking like making sure the file exists ETC but that should otherwise do the job.
Hope it helps
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
Thanks. I knew there had to be a better way.
|
|
|
|
|
That depends on what you define as a line. There is no single method you can call to just return this value. You'd have to write a function that counts the number of lines in the file, according to the rules that you define for a "line", by reading the entire file and counting the lines up, one-by-one.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
What counts as a "line"? A certain non-printing character? (Then just count the number of that character.) A certain line length? (Then take (total chars)/(line length)).
Etc.
|
|
|
|
|
how can i run a process from my program and get it's output? as in running "ipconfig" and getting what was written in the dos window?
|
|
|
|
|
You can use the "> filename" option for this which will save the output to a file. Example:
C:\>ipconfig > ip.txt
|
|
|
|
|
If you need something more interactive, the System.Diagnostics.Process class allows you to replace the default input and output streams that goto the application. In theory (I've never tried) this would allow you to fully automate any command line app by analyzing screen scrapings to feed it new input.
--
CleaKO The sad part about this instance is that none of the users ever said anything [about the problem].
Pete O`Hanlon Doesn't that just tell you everything you need to know about users?
|
|
|
|
|
Process.StandardOutput Property[^]
Take a look at the first example. It shows how to read from a redirected stream and wait for the child process to exit.
"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
|
|
|
|
|
Hi,
I need to build a complex region dividing system.
For example, i want to divide the display in two and then divide one of those sub displays in two again, etc.
For that i'm using the split container.
Basicly i need to dynamicly create split containers.
In the end i need to output a xml file with the regions sizes.
Well, i'm in the beggining of this problem.
For now i have two buttons. One that creates a horizontal split and another a vertical split.
For that i invocate the following method, changing only the orientation:
<br />
private void addNewRegion(System.Windows.Forms.Orientation o)<br />
{<br />
<br />
SplitContainer region = new SplitContainer();<br />
region.SuspendLayout();<br />
this.SuspendLayout();<br />
<br />
region.Dock = System.Windows.Forms.DockStyle.Fill;<br />
region.Location = new System.Drawing.Point(0, 0);<br />
region.Name = "region";<br />
region.Size = new System.Drawing.Size(292, 266);<br />
region.SplitterDistance = Int32.Parse(p.width)/2;<br />
region.TabIndex = 0;<br />
region.Orientation = o;<br />
<br />
this.Controls.Add(region);<br />
region.ResumeLayout(false);<br />
this.ResumeLayout(false);<br />
}<br />
Following the process described above it doesnt work. However if i past the body of the addNewRegion into the Form1_load, the split container is create.
Can anyone explain me why this doesnt work?
Maybe i need to redesign the form. Maybe not.
Any ideas?
Thx,
Nuno
|
|
|
|
|
Try calling this.PerformLayout at the end of the method.
"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
|
|
|
|