Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
GeneralRe: Interesting DB issue Pin
sreejith ss nair21-Nov-04 17:02
sreejith ss nair21-Nov-04 17:02 
GeneralLaunching C# Applications in IE Pin
mkushner21-Nov-04 5:27
mkushner21-Nov-04 5:27 
GeneralRe: Launching C# Applications in IE Pin
Dave Kreskowiak22-Nov-04 4:23
mveDave Kreskowiak22-Nov-04 4:23 
GeneralTab Key in the DataGrid Pin
Hamada_star21-Nov-04 3:53
Hamada_star21-Nov-04 3:53 
GeneralRe: Tab Key in the DataGrid Pin
Jay Shankar22-Nov-04 15:06
Jay Shankar22-Nov-04 15:06 
GeneralDataGrid RightToLeft Property Pin
Hamada_star21-Nov-04 3:45
Hamada_star21-Nov-04 3:45 
GeneralRe: DataGrid RightToLeft Property Pin
sreejith ss nair21-Nov-04 20:01
sreejith ss nair21-Nov-04 20:01 
GeneralDisposing resources used by MD5CryptoServiceProvider Pin
sillypuppy21-Nov-04 2:52
sillypuppy21-Nov-04 2:52 
Hello all Big Grin | :-D

I have this problem with managing resources. I am writing a cataloging application in which i need to compute a MD5 hash value for each file in the tree structure given a directory. This is done recursively. Now until I have added a function to compute the hash everything was working smoothely however now the application freezes.
This could be because i do not have enough free resources. I tried calling a Dispose method of the MD5CryptoServiceProvier but it is protected therefore not allowed to be accessed.
IS Garbage Collector an option? If so where should it be applied.

To give you an idea. The function ComputeHash looks the following:

private string ComputeDigest(FileInfo file)<br />
{	<br />
  MD5CryptoServiceProvider csp = new MD5CryptoServiceProvider();<br />
  FileStream fstream;<br />
  try<br />
  {<br />
	fstream = File.OpenRead(file.FullName);<br />
  }<br />
  catch(Exception e)<br />
  {<br />
  MessageBox.Show("Error Occured: " + e.Message);<br />
  return null;<br />
  }<br />
  byte [] hash = csp.ComputeHash(fstream);<br />
  fstream.Close();<br />
  string hash_string = String.Copy(BitConverter.ToString(hash));<br />
  csp.Clear();<br />
  return hash_string;<br />
}


Izabela
GeneralPorting C++ struct to C# (BladeEnc.dll) Pin
Pr1v21-Nov-04 1:44
Pr1v21-Nov-04 1:44 
QuestionHow Can I Draw lines and text in DataGrid Header Pin
Hamada_star20-Nov-04 22:46
Hamada_star20-Nov-04 22:46 
AnswerRe: How Can I Draw lines and text in DataGrid Header Pin
sreejith ss nair21-Nov-04 16:59
sreejith ss nair21-Nov-04 16:59 
Generalprinting Pin
20-Nov-04 20:51
suss20-Nov-04 20:51 
GeneralRe: printing Pin
Luis Alonso Ramos20-Nov-04 21:26
Luis Alonso Ramos20-Nov-04 21:26 
GeneralRe: printing Pin
sreejith ss nair21-Nov-04 17:07
sreejith ss nair21-Nov-04 17:07 
GeneralCOM+ Transaction and server farms/database clustering Pin
devvvy20-Nov-04 19:10
devvvy20-Nov-04 19:10 
Generalcopying textbox value to another textbox Pin
Member 144657320-Nov-04 18:10
Member 144657320-Nov-04 18:10 
GeneralRe: copying textbox value to another textbox Pin
sreejith ss nair20-Nov-04 18:35
sreejith ss nair20-Nov-04 18:35 
GeneralRe: copying textbox value to another textbox Pin
Charlie Williams20-Nov-04 20:15
Charlie Williams20-Nov-04 20:15 
GeneralRe: copying textbox value to another textbox Pin
Dave Kreskowiak22-Nov-04 4:17
mveDave Kreskowiak22-Nov-04 4:17 
GeneralRe: copying textbox value to another textbox Pin
Charlie Williams20-Nov-04 20:24
Charlie Williams20-Nov-04 20:24 
GeneralRe: copying textbox value to another textbox Pin
Member 144657320-Nov-04 20:50
Member 144657320-Nov-04 20:50 
GeneralClass accesability and namespaces Pin
aspiringCodeMonkey20-Nov-04 17:05
aspiringCodeMonkey20-Nov-04 17:05 
GeneralRe: Class accesability and namespaces Pin
sreejith ss nair20-Nov-04 19:17
sreejith ss nair20-Nov-04 19:17 
GeneralRe: Class accesability and namespaces Pin
Andrew C Armstrong21-Nov-04 11:54
Andrew C Armstrong21-Nov-04 11:54 
GeneralDIVIDE APPLICATION TO FRAMES Pin
binary_c220-Nov-04 16:52
binary_c220-Nov-04 16:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.