|
If MyZip implements IDisposable (which Im willing to bet it does!) then you need to call Dispose() on it.
Setting it to null does nothing to solve the problem you're experiencing.
|
|
|
|
|
You haven't stated what zipFile is (build in .Net functionality? sharpZipLib? Other third party?) however I suspect the problem is you need to call Dispose as well as Close , so that it releases unmanaged resources, in this case the underlying file.
|
|
|
|
|
Thanks for your help i have found a work around from this i am still not 100% sure exactly what MyZip(its company specific).
Thanks for all your help !!!
Dino
|
|
|
|
|
If you are targeting .NET 3.5 or even 4.0 there is a namespace called System.IO.Packaging , which contains some classes that allow working with zip files.
Life is a stage and we are all actors!
|
|
|
|
|
Anybody know of a .net based (ideally C#) .mov (video format) file writer? If not, can anybody point me to a DLL I can use for this?
Thanks,
Chris
|
|
|
|
|
The best I can suggest is to try using ffmpeg called from within .net (http://www.ffmpeg.org/[^]).
It won't be pretty or particularly secure.
|
|
|
|
|
Thanks for the suggestion - looks a bit tricky to use from .Net, but beggars can't be choosy.
|
|
|
|
|
I am working on an application where i need to retrieve data (using query) from a Access database.(ABC.mdb)
Please provide code snippet for this.
it is helpful if you can provide sample which uses dataset .
|
|
|
|
|
|
Did you check on msdn - see here.
My signature "sucks" today
|
|
|
|
|
Thnx..
As shown in the example dataset contain data table information. Now i need to retrieve some set of data from dataset. How to do it.
Can we fire quire on the data available in the dataset.
|
|
|
|
|
Chiman1 wrote: data available in the dataset
So change the query to get the information that you want to get.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Hi everyone, I am little confused about VSC++ header file and class. I am converting a project from VSC++ to C#. In VSC++ I have a header file, since it is a windows application, accessed throughout the application from many different forms. Now I want to have class or codefile does something like that. I do not have much idea how to that exactly.
thanks
|
|
|
|
|
Header files were features that allowed the C/C++ compiler determine what methods a class/file would contain. They didn't necessarily contain any implementation (although some did), but they were included in another file/application using #include so that this could use those methods.
There's no need to do this in .NET. All you need do is add a reference to the DLL that contains the functionality you want to use, add a using statement for the relevant namespace and you have access to all the public methods that class exposes (if your class inherits from it, you get access to the protected methods as well).
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hello Pete O'Hanlon, Thanks for your reply. Now I know were I am. I will go with .dll this is fine with me.
thanks again.
|
|
|
|
|
Pete O'Hanlon wrote: add a using statement
That is not a requirement -- it's a sign of weakness.
|
|
|
|
|
I agree with Pete, of course.
I would like to add my suggestion to buy a book on C# and study it. It is the most effective and efficient way to learn the language; experimenting is fine, and necessary, but by itself it is no guarantee to becoming a good and productive C# programmer.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hello Luc Pattyn, I could not agree more with you. I believe in teaching someone how to catch fish not catching for them.
I have question to you since you have worked on embedded system. I am currently working on windows CE 6.0. I already build the OS. Now I had a application written in VSC++ for desktop. I need to convert it to C# and deploy it on window CE platform( create a smart device application from scratch ). Do you have any suggestion for me besides reading a book (I will read any book necessary regardless).
|
|
|
|
|
Sorry, the embedded systems I work with aren't using any Windows. Nor C#.
I do a lot of C# on desktop Windows though.
For C# you will need some .NET framework, probably the .NET Compact Framework 2.0 or 3.5
You could:
- keep some C/C++ code and use P/Invoke to let C# access it; I do it often on Windows XP/Vista, I understand P/Invoke on WinCE/Compact.NET is somewhat crippled. I have a general article in the works here[^], it contains a link (near the end) to the compact version of P/Invoke.
- convert your C/C++ code to managed C++; I would advise against that, the managed C++/CLI isn't all that popular and quite different from unmanaged C/C++.
- do everything in C#; that would be the recommended way, unless you need functionality that isn't present in the framework.
As for conversion itself, depending on size (and the number of authors), I would do it by hand.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hello All .. I am using net use for accessing network share from my c# code. Couple of times it failed for no reason (return code 2) & when I ran the same net use command from command prompt it worked fine & after that I was again able to use the c# code. Looked like something was stuck. I am actually deleting the network share & before creating it as its an issue if I try to re-create.
Is there a issue with this or a better way of accessing network share?
Below is code snippet
----------------
string command = string.Empty;
System.Diagnostics.ProcessStartInfo procStartInfo;
System.Diagnostics.Process proc = new System.Diagnostics.Process();
command = "net use " + sharedLocation + " //Delete";
procStartInfo = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + command);
procStartInfo.RedirectStandardOutput = true;
procStartInfo.UseShellExecute = false;
procStartInfo.CreateNoWindow = true;
proc = new System.Diagnostics.Process();
proc.StartInfo = procStartInfo;
proc.Start();
proc.WaitForExit();
command = "net use " + sharedLocation + " " + password + @" /user:" + user;
procStartInfo = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + command);
procStartInfo.RedirectStandardOutput = true;
procStartInfo.UseShellExecute = false;
procStartInfo.CreateNoWindow = true;
proc = new System.Diagnostics.Process();
proc.StartInfo = procStartInfo;
proc.Start();
proc.WaitForExit();
----------------
Thanks for your help!!
|
|
|
|
|
Hi. I have the code below which I am using to upload files to my ashx page. It works great, although I cant seem to find a proper way of getting how much it has transferred.
the calling code:
WebClient wc = new WebClient();
wc.OpenWriteCompleted += (s2, e2) =>
{
PushData(e2.Result, offset);
e2.Result.Close();
};
wc.OpenWriteAsync(ub.Uri);
the push data code
private void PushData(Stream output, long offset)
{
byte[] buffer = new byte[4096];
int bytesRead;
bytesRead = theFileStream.Read(buffer, 0, buffer.Length);
if (bytesRead != 0)
{
output.Write(buffer, 0, bytesRead);
totalBytesDone += bytesRead;
FireUpdateEvent(bytesRead);
}
}
The above code is slightly different to my actual code, for brevity sake.
Now, I had presumed that when it gets to output.Write(buffer,0,bytesRead); that that was the point where it sent the actual data and it would lock up and only goto the next line once its finished writing that section. But it goes on to totalBytesDone += bytesRead; before its written anything to the server. I presume the reason is that its doing the writing in a seperate thread in the background(or im actually looking at the wrong section of code and it writes somewhere else) - but for my totalBytesDone code to work i WANT it to lock up until its finished sending(i can put this all in a seperate thread later).
Ive downloaded tons of examples for doing this and they either dont work properly with my ashx file handler(i cant change it) or they use a WebClient method that just reports on 50% progress.
Please help, this is urgent.
Thanks
Strive to be humble enough to take advice, and confident enough to do something about it.
|
|
|
|
|
I am working on winforms i have a datagrid in which i m using autocomplete feature. I am not able to find out how to restrict the user to select data from only autocomplete source. Means the data should be in autocomplete source list. i am using datagrid textbox field (not combobox). if user tries to write data other than auto complete source then i have to restrict it. Can any body help i am totally stucked here.
Regards
Narendra Singh
(Jindal Tech Ventures)
|
|
|
|
|
Hi,
I have made a C# forms application. In there i use a usercontrol that dynamicly puts a list of checkboxes onto the usercontrol. Next to the checkboxes is a scrollbar. If you move the scrollbar the checkboxes will be set onto the selection that is pointed out by the scrollbar. So the Text and Checked state of the checkboxes get updated to the position in the entire list. (in short, i've made my own ListBox with checkboxes)
My problem is that i cannot capture the scroll event of the mouse from checkboxes(using the hardware scrollbutton). The scroll event of the usercontrol itself doesn't get triggerd because of the checkboxes are on top of it. And the checkboxes itself do not have a scroll event.
How can i solve this?
Greetz Willem
|
|
|
|
|
If I have interpreted your question correctly, you are saying that using the scrollwheel on your mouse does not cause the panel to scroll. If I have misunderstood then please disregard the rest of this message.
There are several controls in Visual Studio that suffer from this problem. Sometimes, but not always, this is caused because the control does not have focus. The solution in those cases is to handle the MouseEnter event to give the control focus.
private void myUserControl_MouseEnter(object sender, EventArgs e)
{
myUserControl.Focus();
}
If this doesn't work immediately, then I am probably wrong about the cause.
Good luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
Why do programmers often confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
|
|
|
|
|
This was my first solution and it doesn't work. When i do this my usercontrol will get the focus(the mouseenter event gets fired), but it doesn't fire the scroll event after that. I think this is because the checkboxes override the foces when hovering over it, I think this because the checkbox "lights up" when you hover over it(I use windows 7).
So i think you understood my question right, but the solution doesn't work.
|
|
|
|