|
Hi,
I have a ListView table that contains some files and i would like to know the command that will delete it by clicking some Delete Button.
Thanks in advance for your help.
Eyungwah
|
|
|
|
|
Probably you mean that ListView contains the path of the files. Then simply call File.Delete , passing the text of the ListView Items.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Well, you can use the ListView.SelectedItems property to retrieve a collection of all items that are currently selected. Iterate over the returned collection and for each item delete the respective file by using classes from System.IO namespace (if you really want to delete on the file system) and finally remove the item from the list view via ListView.Items.Remove 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
|
|
|
|
|
what is escape sequencing? how is it useful in c#/Asp.net 2.0?
thank you
|
|
|
|
|
|
An escape sequence is a combination of characters that has a special meaning. The term escape sequence comes from the sequences used with things like a line printer, where the first character is the ESC character.
Escape sequences are used for example in URLs, HTML code, XML code, SQL strings, Javascript strings and C# strings. They are used to insert special characters that can't normally be written.
In URLs the escape character is %, in HTML and XML it is &, in SQL strings it is ' or \ depending on database, in Javascript strings and C# strings it is \.
Some common escape sequences:
C# strings:
\" = quote character
\r = carrege return (character code 13)
\n = line feed (character code 10)
HTML:
& = & character
" = " character
< = < character
> = > character
URL:
%26 = & character
%3f = ? character
%2f = / character
%20 = space character
%25 = % character
---
single minded; short sighted; long gone;
|
|
|
|
|
hi every body
i want to send ascii value of 10
plz help me how can i got ascii value of 10 that means "LF" in VC#.net
plz help me
Prem
|
|
|
|
|
|
system.convert.tochar(10); ?
is this what you are looking for
Russ
|
|
|
|
|
"\u000a" and '\u000a' however those are in unicode. To get the ascii value you would need to use an Ascii Encoder and grab the bytes but why bother, just write 0xa to the stream.
File Not Found
|
|
|
|
|
Hi everyone,
Any idea about how to disconnect from the internet using C#??
Many thanks
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
I don't think that's going to fly for a lot of circumstances.
|
|
|
|
|
The paradox of your question is that you are wanting to use a generic container for content which cannot necessarily be processed generically.
|
|
|
|
|
watch out there, using "urgent in your post subject is not a good idea
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Does anyone has positive expirience with comboboxes that can be bound to nullable properties? I'm developing application in which I often bind ComboBox to DataColumn (with AllowDBNull set to true) of typed DataSet. It works fine but if user selects item it can no longer say - hey set that to Null.
Ideal solution would be something like new DateTimePicker - having ShowCheckBox property and if it is Checked get selected Date, if it is Unchecked get DBNull.Value. (see image below I referenced from one of CodeProject articles)
So any suggestions or I am damned to make control myself?
IMAGE HERE, [article here]
|
|
|
|
|
i had the same problem a few months ago and i also hadn't found a good solution. my workaround was a union including my datatable and an "empty" datarow.
|
|
|
|
|
Funny thing is that MS also suggests this practice:
http://www.windowsforms.net/FAQs/default.aspx?PageID=2&ItemID=722&CategoryID=3&tabindex=3
But again it can't be too hard to make something like DateTimePicker's ShowCheckBox.
|
|
|
|
|
Hi Guys,
Im fairly new to the world of C#.... Im in the process of building a web form that uploads a CSV file to my server from there it will have to read the file and store the output in an Array. Ive read through the countless tutorials on various sites around the place, but im finding this a little tricky. so all i need is a simple class that can read the contents of a CSV and store it in an array. can anyone of you fine c# gurus assist in this relatively simple app ?
cheers
|
|
|
|
|
Hi,
Easy way is this;
using System.IO;
.
.
public string[][] readCSV(string fileName)
{
StreamReader read = new StreamReader(fileName)
string [][] content = new string[100][100];
int row =0;
for(string line = read.ReadLine();line!=null;line=read.readline())
{
content[row][0] = line.Split(',');
row++;
}
return content;
}
Please let me know if it helps
Neo
|
|
|
|
|
string [][] content = new string[100][100]; i was getting an error on this line. invalid rank specifier sorry but i am still only a newbie with c#
|
|
|
|
|
|
How to get icons in GUI
Keshav Kamat
India
|
|
|
|
|
Ok. I got how to add it.
We have to use a tool strip and then add buttons, labels etc accordingly.
However, If i need to change the image of the buttons, for example, if I want a button to display a file icon, I have to change it in the properties.
In that case, I have to choose the image.
Can some one tell me where all the icon files are stored.?
Keshav Kamat
India
|
|
|
|
|
Hi!
i want to use threads in my C# asp.net web application. i m able to use static function in thread but when i use nonstatic function in my thread with the instance of class then it gives no error or exception but thread is not started and no functionlity in done in thread.
Can anybody help me 4 solving this problem. I need pure C# code not Html.
Thanx
|
|
|
|
|
Hmph... when user sends request to server it is serviced in new thread. When that request is finished all resources are released so probably same happens to thread you made and instance of class which method you call.
Surely there are better ways to solve any kind of problem you have... what are you trying to accomplish?
|
|
|
|