|
Ennis Ray Lynch, Jr. wrote: On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage
Stealing my old signatures? Would you steal my grave as quick?
|
|
|
|
|
With apologies, I just rotate through cool stuff I have copied and pasted in a sigs text file. Perhaps you can take it as a compliment rather than an offense
On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: With apologies, .... Perhaps you can take it as a compliment
Oh no. I do take it as a compliment.
I guess even the smilies around my very poor joke didn't work. (Since starting to work in Glasgow I'm picking up their very cynical sense of humour - And I move there next month so I guess it is going to get worse!)
|
|
|
|
|
Those damn irish, j/k
On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage
|
|
|
|
|
for heavens sake, when a hint is given to you you should at least try it.
Anyway, I also was happy when people helped me with my probs, so here is my suggestion:
private void InitializeStreamReader()
{
System.IO.FileStream fstream = System.IO.File.OpenRead(@"c:\test.dat");
System.IO.StreamReader sreader = new System.IO.StreamReader(fstream);
string[] filecontent = sreader.ReadToEnd().Split('\n');
sreader.Close();
foreach (string contentTemp in filecontent)
{
Console.WriteLine(contentTemp);
}
}
Here is a short explanation what is done in this example:
A Filestream is created
A Streamreader which uses the Filestream
the streamreader reads all the content of the file an splits it by the new lines
(every new line is a new element)
these elements are used in a string array
the streamreader is being closed
and now to the interesting part:
every line in the string array is being displayed via console.writeline
Of course it can be done easier, but I think you´ll like it this way as well
|
|
|
|
|
Ezazel
Thanks a lot. I think I see the "why" ...
|
|
|
|
|
Ive been trying to find an example on how to make a progress bar progress with the copying of a file using the copyTo command. does anyone know how to make it work?
|
|
|
|
|
You won't be able to do a real progress bar with File.Copy because it is synchronous and does not give any feedback as to the overall progress of the operation.
You could easily do this yourself, however. Open the file you want to copy, and create a destination file you want to copy the file to. Read in the source file byte-by-byte, and write those bytes to the destination file. Every few bytes, raise an event indicating the overall progress of the operation. Interested components would simply listen to that event and could update the value of a progress bar if they wanted.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: And in this corner, the Party of Allah
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
How would I go about doing this? Im still pretty new to C# and havent learned alot of things yet
|
|
|
|
|
|
Up
I am a chinese I love my country.
|
|
|
|
|
there is a much simpler option. Simply add the reference, Microsoft.VisualBasic dll to your c# references project.
Within the Microsoft.VisualBasic dll is the VB.NET file copy routine which displays a copy progress dialog much like the windows one. Here is an example.
Microsoft.VisualBasic.FileIO.FileSystem.CopyFile("c:\helloworld.txt","c:\temp\helloworld.txt",UIOption.AllDialogs,UICancelOption.DoNothing);
|
|
|
|
|
Hi,
i tried ur way but cought in probs.
i gives me with error
"the type or namespace name 'FileIO' does not exists in the class or namespace 'microsoft.visualbasic' (are you missing ans assembly reference?)"
i have also included the reference in the project of microsoft.visualbasic
dont know wats the prob.
can u help?
Nitin...
|
|
|
|
|
Are you using visual studio 2005? As it works for me under that IDE. Apart from that I cant work out what could be your problem.
|
|
|
|
|
Hi,
thanx for reply.
no i m not using vs2005.
i am using vs2003.
can u help.
thanx
Nitin...
|
|
|
|
|
go buy a copy of visual studio 2005.
|
|
|
|
|
This sounds like a good option, except the progress bar I am using is in the status strip instead of a dialog box
|
|
|
|
|
I am using collections for the first time and can't seem to figure out how to obtain the index of the last entry in the collection.
I am guessing that I could use IndexOf() or LastIndexOf() methods, but not sure what to pass into the method.
Here is the code
public static class NumberProcessing<br />
{<br />
public static void UpdateSpinDataCollection()<br />
{<br />
SpinDataCollection.Add(new SpinData <br />
SpinNumber,<br />
CurrentNumber,<br />
Colour<br />
OddorEven);<br />
<br />
SDCPointer = (short)SpinDataCollection.LastIndexOf();<br />
<br />
MessageBox.Show("SDCPointer:\t" + SDCPointer.ToString());<br />
}<br />
}
Haz
|
|
|
|
|
What's the SpinDataCollection type? a Generic collection? An ArrayList?? What???
I'm on a Fuzzy State: Between 0 an 1
|
|
|
|
|
Sorry, it is a generic collection.
public static List<SpinData> SpinDataCollection = new List<SpinData>();
Haz
|
|
|
|
|
The pointy brackets containing the <spindata> bits have been removed from the code by the editor in my previous reply, not sure how to override that when posting here.
Haz
|
|
|
|
|
haz13 wrote: The pointy brackets containing the bits have been removed from the code by the editor in my previous reply, not sure how to override that when posting here.
Put the following characters together for a "less than" character: < When you post it, it will look like <
For "greater than" character, use the combination >, which will result in >
Alternately, you can check the "Ignore HTML tags in this message (good for code snippets)" checkbox when you go to post, which will ignore HTML symbols such as the "greater than" and "less than" characters.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: And in this corner, the Party of Allah
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
No, the editor doesn't remove them. Consider it as html. You can check the little check box to tell it to ignore html tags or you can replace your <'s with <'s and >'s with >'s.
Logifusion[^]
If not entertaining, write your Congressman.
|
|
|
|
|
|
Thank you all
Haz
|
|
|
|