|
What do you mean?
The one and only Niklas Ulvinge aka IDK
|
|
|
|
|
Could you please test the same without PRINT and Console.WriteLine?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Gee whiz, considering that 2GL and early 3GL compilers and linkers had very few commands to operate on compared to today's super compilers it's realy no surprise. However just because C# might not be the fastest language ever invented, development time is cut down, and oh btw, good luck on trying to write a GUI, TCP/IP stream processor, and SQL interface using Assembler. Yeah you could do it but for what purpose?
I used to be an assembler programmer (back in the 80s!) and I'll admit to being concerned about shaving cycles and optimizing every instruction. But those are memories I'll gladly leave behind.
Mike
|
|
|
|
|
Hi all,
I wanna write a program that can monitor and discover any change of file in windows sytem and notify the change to user. where should i begin and what should i read ?
Thanks,
ken
|
|
|
|
|
You can simply use FileSystemWatcher class. It's easy to use. for more information see msdn on this topic.
|
|
|
|
|
Here is some input parameter and a return value of a oracle storage procedure.
How to run with Oledb and get the return value?
Thanks!
|
|
|
|
|
how to save a file using a savefiledialog in C#.what is the complete code for it? how do we use the savefiledialog .
-- modified at 3:43 Saturday 19th November, 2005
|
|
|
|
|
|
v.k.s wrote: how to save a file using a savefiledialog
As stephan already said, the MSDN documentation shows you how.
However, the SaveFileDialog will not save your file for you. It will only generate a standard interface by which your user can choose a location for their file. Once you have that file path you have to save the file yourself. And, no, I cannot give you code for that as I know nothing about the file that you want to save or how you want to save it. If you need to do that, you will have to ask a more specific question with more detail.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
Hi
As our friends said , the savefiledialoge cannot save but can go and read a path to save.
first of all make a filter for your savefiledial. to have an extension for your file name
then with savefiledialoge.show(); you will have the dialoge
after that you can specify a lable for your file path.
make a lable and do this label1.text=savefiledialoge.filename;
after that you can have a file to save
FileStream fs=new FileStream(svdg.FileName,FileMode.Create);
and you can do everything with it
be careful to run fs.close(); after your file.
May MSDN is a bit difficult but it is really useful.
Hope that is work.
|
|
|
|
|
Hello!
I want to add description to my functions that users who uses them can know what's its work, Like .Net framework functions. For an example when we type MessageBox instruction we see some descriptions about that.
Please if you know about this Help Me.
Thank You.
-- modified at 1:42 Saturday 19th November, 2005
|
|
|
|
|
just type /// above the function name and type the comment there . i havent used it , but i heard one of my colleagues mention it a day ago..You can always try
|
|
|
|
|
|
Note, when filling out your documentation, only the information contained in the <summary> and <param> tags get put in the IntelliSense tooltips.
"we must lose precision to make significant
statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
How can I read a string from a database field byte by byte? the DataReader class has two methods that seem useful: ReadBytes and ReadChars . The problem is that the former method can't be applied to a field of type string and the latter one reads the string char by char, not byte by byte. It also seems that the default encoding used by ReadChars method is unicode.
Notice that I don't want to read the bytes from a filled dataset , because after filling the dataset by a DataAdapter , there is a change made to the string that've been read.
Please help!
|
|
|
|
|
I think that what is happening is that the bytes are being altered because they are being stored in different ways to how .NET wants a string. If you really need the bytes then you are going to have to store the bytes in the first place.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
And when i write the string to a file, it doesnt get the newline bit right, you just get a bar.
So how do i get it to do a new line. (I would REALLY like to do this without having to do WriteLine every time i need a new line).
|
|
|
|
|
Shouldn't you use \r\n instead?
-
Drew
|
|
|
|
|
|
The correct way to do this is use Environment.NewLine as it will generate the correct newline sequence for the current platform.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
I have create a panel and then place a listBox control. I want to read a text file and place it into the listbox:
***************************************************************
listBox1.Text=" ";
listBox1.Location = new System.Drawing.Point(16,16);
listBox1.Size = new Size (320,220);
listBox1.BackColor = Color.FromArgb(255, 255,255);
panel1.Controls.AddRange(new Control[]{llistBox1});
// Open the file
SR = File.OpenText(@myFile.Text);
// Loop trough each character in the file
while((FileChar = SR.Read()) != -1)
{
// Display the text in the TextBox
listBox.Text += Convert.ToChar(FileChar);
}
// Close the reader
SR.Close();
}
****************************************************************
the above does not displays the text however if I use a labe then it works but I can not sroll the text once is displayed in the labe control.
Is there a better way to display the TXT in a list or label contrl?
|
|
|
|
|
Well, i've just been doing this kind of stuff, if you want to add a line of the file to your list box then maybe you could:
StreamReader SR;<br />
<br />
FileStream FS = File.Open("location of file", FileMode.Open, FileAccess.Read);<br />
<br />
SR = new StreamReader(FS);<br />
<br />
listBox.Items.Add(SR.ReadLine());<br />
Then just keep doing that until you get to the end of the file, i'm too tired to think of the code right now, i'm only still up cus i'm watching children in need
and dont forget to close and null your StreamReader
|
|
|
|
|
The code seems to work right
**************************************************
StreamReader SR;
FileStream FS = File.Open("myFile.txt", FileMode.Open, FileAccess.Read);
SR = new StreamReader(FS);
while((FileChar = SR.Read()) != -1)
{
viewS.Items.Add(SR.ReadLine());
}
SR.Close();
****************************************************
but the first character in every line is truncated.
any idea?
|
|
|
|
|
picasso2 wrote: The code seems to work right
picasso2 wrote: but the first character in every line is truncated.
Then it DOES NOT work right. Do as the other person suggested. You can't will the CPU to do something.
xacc.ide-0.1-rc4 released! Download and screenshots
|
|
|
|
|
If you look at the code, you noticed that I "DID" what it was suggested.!!!!!
|
|
|
|