|
Sha Sea wrote: Thankx.
Even i put the MessageBox.Show() it is not showing anything.
Its weird thing for me.
What do you say?
You could test the code in an attribute class by creating an object with new . Another possibility is to not use attributes for what you're doing.
Nathan
|
|
|
|
|
hello!
plz can some body tell me in c# how can i delete a file used by another process?
i'm trying to delete a file by:
File.Delete(@"C:\test.txt");
a System.IO.IOException appear:
"cannot acess the file because it is being used by another process."
I don't know where in my application i'm using this file, but i need to delete it.
thank you
Best Regards,
Jimmy.
|
|
|
|
|
If your application has opened this file then you should close it properly by calling the Close() method of a stream so that other processes (as well as yours) can access it.
If you need to force file delete then you will need to close all open handles to this file. Here is a link which describes how to do it. You will need P/Invoke to port it to c#
Deleting Locked Files[^]
|
|
|
|
|
Also, when you "force" the file to be close, don't be surprised when the process that opened it crashes...
|
|
|
|
|
Dave Kreskowiak wrote: "force" the file to be close, don't be surprised when the process that opened it crashes...
My same thoughts. I don't know why he wants to delete a locked file in the first place. Sounds potentially dangerous.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Sir, its me again.. i have been having some problems on networking in c#.. it involves databasing.. i tried downloading the data from the server that i have created.. the idea was, i should be able to download the data on a database that is located on the server that i have made, but whenever i tried to open the data on my client side, it always returns an exception.. nullReference... but when i tried testing it on the server, the data was read.. can you help me again sir on how can i resolve this problem.. The formatter that i was using is a Binary Formatter, and the channel is tcp channel.. thank you sir..
-- modified at 11:24 Friday 14th September, 2007
|
|
|
|
|
Hi people...
I know that exists a HelpProvider component... but I think that writing a pdf is much more comfortable than 1000 topics (with related 1000 .htm pages)!
Is there a way to open a pdf file at a specified index? Or HelpProvider gives other possibilities instead of chm or htm files?
If I do have to create a htmlhelp file, which editor do you suggest?
|
|
|
|
|
People expect help files to be CHM or HLP files, and to be honest it's easier for people to use the search facilities in help files. Anyway, I like HelpScribble[^].
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
if i want to delete the selected row in a list view i use:
if (listView1.SelectedItems.Count > 0)
{
if (MessageBox.Show("Vill du verkligen ta bort denna?", "Mina jobb",
MessageBoxButtons.YesNo, MessageBoxIcon.Question)
== DialogResult.Yes)
{
for (int i = listView1.SelectedItems.Count - 1; i >= 0; i--)
listView1.Items.Remove(listView1.SelectedItems);
}
}
But if i want to delete this selected row from a .txt file how do i do that..???
it´s four subitems and the .txt file look like this
#
blah
blablah
blabl
blaaa
//thanks;);P sigh:
|
|
|
|
|
andredani wrote: But if i want to delete this selected row from a .txt file how do i do that..???
It's your course assignment not ours. I'm pretty sure the point of the assignment is for "you" to figure that out rather than for you to go out on the internet and ask people how to do it. I mean really, you are in school now, if this is not the time when you are going to start thinking for yourself and developing problem solving skills, when are you?
|
|
|
|
|
Hi,
my c# project includes an embedded resource called "driver.resources", which contains a driver called "test.sys".
A read alot about extracting txt/bmp/ico files, but i can't figure out how to extract my test.sys driver.
Any suggestions?
Thx in advance, knack
|
|
|
|
|
This article will help you to do that: http://www.codeproject.com/csharp/SlideShowBuilder.asp
|
|
|
|
|
This article also deals only with images, but how can i extract a file independent from its file type?
I want to extract my test.sys driver.
|
|
|
|
|
In that case have a look at my another article: http://www.codeproject.com/useritems/mp3toexe.asp
|
|
|
|
|
|
You are welcome
|
|
|
|
|
Hello,
I have a data grid view with a column that contains decimals.. (eg. 12345.67890) I Would like to format the data grid view to only show two decimal places. (eg. 12345.67) Any help would be great!
J
|
|
|
|
|
|
|
You are welcome
|
|
|
|
|
Hello
I search a map control that can display ECW maps with latitude and longitude coordinates. I can also pay something for this control.
Thanks for helps
|
|
|
|
|
Dundas has one, don't they ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yes but they can't display ECW files. I must have a control that displays maps in ECW format.
PS: Thanks for the reply!
|
|
|
|
|
Hello,
On a lot of websites now, you can just enter your house number and postcode and it will bring up the rest of the details. Well, i want to implement this into one of my projects.
Does anyone know what this is called? and if so, is it free to download?
Regards,
Gareth.
|
|
|
|
|
Downloading something is unlikely as you'll need a regularly-updated database of postcodes and addresses. As you said postcode, I assume you want details for the UK, so Royal Mail provide all this information, but not for free.
There are companies that provide web services to do what you want, again unlikely to be free.
Try here.[^]
|
|
|
|