471,089 Members | 1,684 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,089 software developers and data experts.

Finally block causing exception to throw twice with CryptoStream?

TC
Hey All,

I posted this to the Crypto users group and forgot to add the VB.Net users
group. I apologize for any confusion.

I have been testing a try / catch / finally block and purposely raising
exceptions and I've noticed that if an exception of "Length of the data to
decrypt is invalid." is raised with the CryptoStream object, later this
exception will get raised a second time and thrown to the caller when trying
to close the stream in a Finally block.

For example:

Try
' Do tasks that cause CryptoStream to throw invalid length while
decrypting

Catch ex as CryptographicException
' Handle exception here
Finally
If Not MemStream is Nothing then
' No 2nd exception thrown here
MemStream.Close()
End If

If Not CrypStream is Nothing then
' Exception thrown a 2nd time
CrypStream.Close()
End If
Has anyone else experienced the above?

If so, how to address the problem or is this a bug?


Jun 27 '08 #1
9 1812
On May 18, 7:36 pm, "TC" <getmyemai...@yahoo.comwrote:
Hey All,

I posted this to the Crypto users group and forgot to add the VB.Net users
group. I apologize for any confusion.

I have been testing a try / catch / finally block and purposely raising
exceptions and I've noticed that if an exception of "Length of the data to
decrypt is invalid." is raised with the CryptoStream object, later this
exception will get raised a second time and thrown to the caller when trying
to close the stream in a Finally block.

For example:

Try
' Do tasks that cause CryptoStream to throw invalid length while
decrypting

Catch ex as CryptographicException
' Handle exception here
Finally
If Not MemStream is Nothing then
' No 2nd exception thrown here
MemStream.Close()
End If

If Not CrypStream is Nothing then
' Exception thrown a 2nd time
CrypStream.Close()
End If

Has anyone else experienced the above?

If so, how to address the problem or is this a bug?
TC,
Do you experience the same problem when you use "Using-End Using"
statement instead of Try-Catch for CryptoStream object?

Thanks,

Onur Güzel
Jun 27 '08 #2
TC
Hey Onur,

So you would recommend something like the following:

MyFunction(ByVal encryptString as String) as String
Try
Using(MyCryptoStream)
' Do Crypto tasks
return MyEncryptedString
End Using
Catch ex as CryptographicException
HandleCryptoException ex
Catch ex as Exception
HandleException(ex)
return Nothing
Finally
If Not MyMemoryStream Is Nothing Then
MyMemoryStream.Close
End If
' Do not close CryptoStream here as it causes duplicitous
exception
' The 'Using' block will dispose of any CryptoStream resources
End Function

The above does not cause the duplicitous exception to be thrown.

Thanks,

Todd
"kimiraikkonen" <ki*************@gmail.comwrote in message
news:e7**********************************@a23g2000 hsc.googlegroups.com...
On May 18, 7:36 pm, "TC" <getmyemai...@yahoo.comwrote:
Hey All,

I posted this to the Crypto users group and forgot to add the VB.Net users
group. I apologize for any confusion.

I have been testing a try / catch / finally block and purposely raising
exceptions and I've noticed that if an exception of "Length of the data to
decrypt is invalid." is raised with the CryptoStream object, later this
exception will get raised a second time and thrown to the caller when
trying
to close the stream in a Finally block.

For example:

Try
' Do tasks that cause CryptoStream to throw invalid length while
decrypting

Catch ex as CryptographicException
' Handle exception here
Finally
If Not MemStream is Nothing then
' No 2nd exception thrown here
MemStream.Close()
End If

If Not CrypStream is Nothing then
' Exception thrown a 2nd time
CrypStream.Close()
End If

Has anyone else experienced the above?

If so, how to address the problem or is this a bug?
TC,
Do you experience the same problem when you use "Using-End Using"
statement instead of Try-Catch for CryptoStream object?

Thanks,

Onur Güzel
Jun 27 '08 #3
On May 19, 1:10*pm, "TC" <getmyemai...@yahoo.comwrote:
Hey Onur,

* * So you would recommend something like the following:

* * MyFunction(ByVal encryptString as String) as String
* * * * Try
* * * * * * Using(MyCryptoStream)
* * * * * * * * ' Do Crypto tasks
* * * * * * * * return MyEncryptedString
* * * * * * End Using
* * * * Catch ex as CryptographicException
* * * * * * HandleCryptoException ex
* * * * Catch ex as Exception
* * * * * * HandleException(ex)
* * * * * * return Nothing
* * * * Finally
* * * * * * If Not MyMemoryStream Is Nothing Then
* * * * * * * * MyMemoryStream.Close
* * * * * * End If
* * * * * * ' Do not close CryptoStream here as it causes duplicitous
exception
* * * * * * ' The 'Using' block will dispose of any CryptoStream resources
* * End Function

The above does not cause the duplicitous exception to be thrown.

Thanks,

Todd

"kimiraikkonen" <kimiraikkone...@gmail.comwrote in message

news:e7**********************************@a23g2000 hsc.googlegroups.com...
On May 18, 7:36 pm, "TC" <getmyemai...@yahoo.comwrote:


Hey All,
I posted this to the Crypto users group and forgot to add the VB.Net users
group. *I apologize for any confusion.
I have been testing a try / catch / finally block and purposely raising
exceptions and I've noticed that if an exception of "Length of the data to
decrypt is invalid." is raised with the CryptoStream object, later this
exception will get raised a second time and thrown to the caller when
trying
to close the stream in a Finally block.
For example:
Try
* * *' Do tasks that cause CryptoStream to throw invalid length while
decrypting
Catch ex as CryptographicException
* * ' Handle exception here
Finally
* * If Not MemStream is Nothing then
* * * * ' No 2nd exception thrown here
* * * * MemStream.Close()
* * End If
* * If Not CrypStream is Nothing then
* * * * ' Exception thrown a 2nd time
* * * * CrypStream.Close()
* * End If
Has anyone else experienced the above?
If so, how to address the problem or is this a bug?

TC,
Do you experience the same problem when you use "Using-End Using"
statement instead of Try-Catch for CryptoStream object?

Thanks,

Onur Güzel- Hide quoted text -

- Show quoted text -
Hi,
If it solves your problem, it's OK, however you can also try to put
try-catch inside Using-End Using without "Finally" because "Using-End
Using" does all the disposal operation:
MyFunction(ByVal encryptString as String) as String

Using(MyCryptoStream)
Try
' Do Crypto tasks
return MyEncryptedString

Catch ex as CryptographicException
HandleCryptoException ex
' The 'Using' block will dispose of any CryptoStream
resources
End Using
End Function
Thanks,

Onur Güzel

Jun 27 '08 #4
TC
Ahhh... right... got it!

Thanks

"kimiraikkonen" <ki*************@gmail.comwrote in message
news:72**********************************@r66g2000 hsg.googlegroups.com...
On May 19, 1:10 pm, "TC" <getmyemai...@yahoo.comwrote:
Hey Onur,

So you would recommend something like the following:

MyFunction(ByVal encryptString as String) as String
Try
Using(MyCryptoStream)
' Do Crypto tasks
return MyEncryptedString
End Using
Catch ex as CryptographicException
HandleCryptoException ex
Catch ex as Exception
HandleException(ex)
return Nothing
Finally
If Not MyMemoryStream Is Nothing Then
MyMemoryStream.Close
End If
' Do not close CryptoStream here as it causes duplicitous
exception
' The 'Using' block will dispose of any CryptoStream resources
End Function

The above does not cause the duplicitous exception to be thrown.

Thanks,

Todd

"kimiraikkonen" <kimiraikkone...@gmail.comwrote in message

news:e7**********************************@a23g2000 hsc.googlegroups.com...
On May 18, 7:36 pm, "TC" <getmyemai...@yahoo.comwrote:


Hey All,
I posted this to the Crypto users group and forgot to add the VB.Net
users
group. I apologize for any confusion.
I have been testing a try / catch / finally block and purposely raising
exceptions and I've noticed that if an exception of "Length of the data
to
decrypt is invalid." is raised with the CryptoStream object, later this
exception will get raised a second time and thrown to the caller when
trying
to close the stream in a Finally block.
For example:
Try
' Do tasks that cause CryptoStream to throw invalid length while
decrypting
Catch ex as CryptographicException
' Handle exception here
Finally
If Not MemStream is Nothing then
' No 2nd exception thrown here
MemStream.Close()
End If
If Not CrypStream is Nothing then
' Exception thrown a 2nd time
CrypStream.Close()
End If
Has anyone else experienced the above?
If so, how to address the problem or is this a bug?

TC,
Do you experience the same problem when you use "Using-End Using"
statement instead of Try-Catch for CryptoStream object?

Thanks,

Onur Güzel- Hide quoted text -

- Show quoted text -
Hi,
If it solves your problem, it's OK, however you can also try to put
try-catch inside Using-End Using without "Finally" because "Using-End
Using" does all the disposal operation:
MyFunction(ByVal encryptString as String) as String

Using(MyCryptoStream)
Try
' Do Crypto tasks
return MyEncryptedString

Catch ex as CryptographicException
HandleCryptoException ex
' The 'Using' block will dispose of any CryptoStream
resources
End Using
End Function
Thanks,

Onur Güzel
Jun 27 '08 #5
TC
Hey Onur,

Just to be clear, even though the 'Using' block is for the CryptoStream, it
will also dispose of the MemoryStream resources as well because it is within
that block (i.e. the 'Using' block not only applies to the IDisposable
interface of its calling object which, in this case, is the CryptoStream but
also the IDisposable interfaces available to objects within the block as
well)?

Thanks,

TC

"kimiraikkonen" <ki*************@gmail.comwrote in message
news:72**********************************@r66g2000 hsg.googlegroups.com...
On May 19, 1:10 pm, "TC" <getmyemai...@yahoo.comwrote:
Hey Onur,

So you would recommend something like the following:

MyFunction(ByVal encryptString as String) as String
Try
Using(MyCryptoStream)
' Do Crypto tasks
return MyEncryptedString
End Using
Catch ex as CryptographicException
HandleCryptoException ex
Catch ex as Exception
HandleException(ex)
return Nothing
Finally
If Not MyMemoryStream Is Nothing Then
MyMemoryStream.Close
End If
' Do not close CryptoStream here as it causes duplicitous
exception
' The 'Using' block will dispose of any CryptoStream resources
End Function

The above does not cause the duplicitous exception to be thrown.

Thanks,

Todd

"kimiraikkonen" <kimiraikkone...@gmail.comwrote in message

news:e7**********************************@a23g2000 hsc.googlegroups.com...
On May 18, 7:36 pm, "TC" <getmyemai...@yahoo.comwrote:


Hey All,
I posted this to the Crypto users group and forgot to add the VB.Net
users
group. I apologize for any confusion.
I have been testing a try / catch / finally block and purposely raising
exceptions and I've noticed that if an exception of "Length of the data
to
decrypt is invalid." is raised with the CryptoStream object, later this
exception will get raised a second time and thrown to the caller when
trying
to close the stream in a Finally block.
For example:
Try
' Do tasks that cause CryptoStream to throw invalid length while
decrypting
Catch ex as CryptographicException
' Handle exception here
Finally
If Not MemStream is Nothing then
' No 2nd exception thrown here
MemStream.Close()
End If
If Not CrypStream is Nothing then
' Exception thrown a 2nd time
CrypStream.Close()
End If
Has anyone else experienced the above?
If so, how to address the problem or is this a bug?

TC,
Do you experience the same problem when you use "Using-End Using"
statement instead of Try-Catch for CryptoStream object?

Thanks,

Onur Güzel- Hide quoted text -

- Show quoted text -
Hi,
If it solves your problem, it's OK, however you can also try to put
try-catch inside Using-End Using without "Finally" because "Using-End
Using" does all the disposal operation:
MyFunction(ByVal encryptString as String) as String

Using(MyCryptoStream)
Try
' Do Crypto tasks
return MyEncryptedString

Catch ex as CryptographicException
HandleCryptoException ex
' The 'Using' block will dispose of any CryptoStream
resources
End Using
End Function
Thanks,

Onur Güzel
Jun 27 '08 #6
TC
Hey Onur,

Perhaps better said, in C#, one can do something like the following:

Using (object1, object2, object 3)
// Perform tasks
End Using

Is there a syntax for something similar in VB.Net or does one have to nest
the 'Using' statements like this:

Using (object1)
Using(object2)
// Perform tasks
End Using
End Using

Thanks,

TC

"kimiraikkonen" <ki*************@gmail.comwrote in message
news:72**********************************@r66g2000 hsg.googlegroups.com...
On May 19, 1:10 pm, "TC" <getmyemai...@yahoo.comwrote:
Hey Onur,

So you would recommend something like the following:

MyFunction(ByVal encryptString as String) as String
Try
Using(MyCryptoStream)
' Do Crypto tasks
return MyEncryptedString
End Using
Catch ex as CryptographicException
HandleCryptoException ex
Catch ex as Exception
HandleException(ex)
return Nothing
Finally
If Not MyMemoryStream Is Nothing Then
MyMemoryStream.Close
End If
' Do not close CryptoStream here as it causes duplicitous
exception
' The 'Using' block will dispose of any CryptoStream resources
End Function

The above does not cause the duplicitous exception to be thrown.

Thanks,

Todd

"kimiraikkonen" <kimiraikkone...@gmail.comwrote in message

news:e7**********************************@a23g2000 hsc.googlegroups.com...
On May 18, 7:36 pm, "TC" <getmyemai...@yahoo.comwrote:


Hey All,
I posted this to the Crypto users group and forgot to add the VB.Net
users
group. I apologize for any confusion.
I have been testing a try / catch / finally block and purposely raising
exceptions and I've noticed that if an exception of "Length of the data
to
decrypt is invalid." is raised with the CryptoStream object, later this
exception will get raised a second time and thrown to the caller when
trying
to close the stream in a Finally block.
For example:
Try
' Do tasks that cause CryptoStream to throw invalid length while
decrypting
Catch ex as CryptographicException
' Handle exception here
Finally
If Not MemStream is Nothing then
' No 2nd exception thrown here
MemStream.Close()
End If
If Not CrypStream is Nothing then
' Exception thrown a 2nd time
CrypStream.Close()
End If
Has anyone else experienced the above?
If so, how to address the problem or is this a bug?

TC,
Do you experience the same problem when you use "Using-End Using"
statement instead of Try-Catch for CryptoStream object?

Thanks,

Onur Güzel- Hide quoted text -

- Show quoted text -
Hi,
If it solves your problem, it's OK, however you can also try to put
try-catch inside Using-End Using without "Finally" because "Using-End
Using" does all the disposal operation:
MyFunction(ByVal encryptString as String) as String

Using(MyCryptoStream)
Try
' Do Crypto tasks
return MyEncryptedString

Catch ex as CryptographicException
HandleCryptoException ex
' The 'Using' block will dispose of any CryptoStream
resources
End Using
End Function
Thanks,

Onur Güzel
Jun 27 '08 #7
On May 20, 4:35 pm, "TC" <getmyemai...@yahoo.comwrote:
Hey Onur,

Perhaps better said, in C#, one can do something like the following:

Using (object1, object2, object 3)
// Perform tasks
End Using

Is there a syntax for something similar in VB.Net or does one have to nest
the 'Using' statements like this:

Using (object1)
Using(object2)
// Perform tasks
End Using
End Using

Thanks,

TC

"kimiraikkonen" <kimiraikkone...@gmail.comwrote in message

news:72**********************************@r66g2000 hsg.googlegroups.com...
On May 19, 1:10 pm, "TC" <getmyemai...@yahoo.comwrote:
Hey Onur,
So you would recommend something like the following:
MyFunction(ByVal encryptString as String) as String
Try
Using(MyCryptoStream)
' Do Crypto tasks
return MyEncryptedString
End Using
Catch ex as CryptographicException
HandleCryptoException ex
Catch ex as Exception
HandleException(ex)
return Nothing
Finally
If Not MyMemoryStream Is Nothing Then
MyMemoryStream.Close
End If
' Do not close CryptoStream here as it causes duplicitous
exception
' The 'Using' block will dispose of any CryptoStream resources
End Function
The above does not cause the duplicitous exception to be thrown.
Thanks,
Todd
"kimiraikkonen" <kimiraikkone...@gmail.comwrote in message
news:e7**********************************@a23g2000 hsc.googlegroups.com...
On May 18, 7:36 pm, "TC" <getmyemai...@yahoo.comwrote:
Hey All,
I posted this to the Crypto users group and forgot to add the VB.Net
users
group. I apologize for any confusion.
I have been testing a try / catch / finally block and purposely raising
exceptions and I've noticed that if an exception of "Length of the data
to
decrypt is invalid." is raised with the CryptoStream object, later this
exception will get raised a second time and thrown to the caller when
trying
to close the stream in a Finally block.
For example:
Try
' Do tasks that cause CryptoStream to throw invalid length while
decrypting
Catch ex as CryptographicException
' Handle exception here
Finally
If Not MemStream is Nothing then
' No 2nd exception thrown here
MemStream.Close()
End If
If Not CrypStream is Nothing then
' Exception thrown a 2nd time
CrypStream.Close()
End If
Has anyone else experienced the above?
If so, how to address the problem or is this a bug?
TC,
Do you experience the same problem when you use "Using-End Using"
statement instead of Try-Catch for CryptoStream object?
Thanks,
Onur Güzel- Hide quoted text -
- Show quoted text -

Hi,
If it solves your problem, it's OK, however you can also try to put
try-catch inside Using-End Using without "Finally" because "Using-End
Using" does all the disposal operation:

MyFunction(ByVal encryptString as String) as String

Using(MyCryptoStream)
Try
' Do Crypto tasks
return MyEncryptedString

Catch ex as CryptographicException
HandleCryptoException ex
' The 'Using' block will dispose of any CryptoStream
resources
End Using
End Function

Thanks,

Onur Güzel
TC,
To make sure that all of your disposable resources are disposed
clearly by Using statement, you can also use seperate "Using"s for
each disposable object like:

Using block1 As New DisposableObject1
'Statements here
End Using

Using block2 As New DisposableObject2
'Statements here
End Using

and so on...

Better ideas may exist of course.

Thanks,

Onur Güzel
Jun 27 '08 #8
On May 20, 7:36 pm, kimiraikkonen <kimiraikkone...@gmail.comwrote:
On May 20, 4:35 pm, "TC" <getmyemai...@yahoo.comwrote:
Hey Onur,
Perhaps better said, in C#, one can do something like the following:
Using (object1, object2, object 3)
// Perform tasks
End Using
Is there a syntax for something similar in VB.Net or does one have to nest
the 'Using' statements like this:
Using (object1)
Using(object2)
// Perform tasks
End Using
End Using
Thanks,
TC
"kimiraikkonen" <kimiraikkone...@gmail.comwrote in message
news:72**********************************@r66g2000 hsg.googlegroups.com...
On May 19, 1:10 pm, "TC" <getmyemai...@yahoo.comwrote:
Hey Onur,
So you would recommend something like the following:
MyFunction(ByVal encryptString as String) as String
Try
Using(MyCryptoStream)
' Do Crypto tasks
return MyEncryptedString
End Using
Catch ex as CryptographicException
HandleCryptoException ex
Catch ex as Exception
HandleException(ex)
return Nothing
Finally
If Not MyMemoryStream Is Nothing Then
MyMemoryStream.Close
End If
' Do not close CryptoStream here as it causes duplicitous
exception
' The 'Using' block will dispose of any CryptoStream resources
End Function
The above does not cause the duplicitous exception to be thrown.
Thanks,
Todd
"kimiraikkonen" <kimiraikkone...@gmail.comwrote in message
>news:e7**********************************@a23g200 0hsc.googlegroups.com....
On May 18, 7:36 pm, "TC" <getmyemai...@yahoo.comwrote:
Hey All,
I posted this to the Crypto users group and forgot to add the VB.Net
users
group. I apologize for any confusion.
I have been testing a try / catch / finally block and purposely raising
exceptions and I've noticed that if an exception of "Length of the data
to
decrypt is invalid." is raised with the CryptoStream object, later this
exception will get raised a second time and thrown to the caller when
trying
to close the stream in a Finally block.
For example:
Try
' Do tasks that cause CryptoStream to throw invalid length while
decrypting
Catch ex as CryptographicException
' Handle exception here
Finally
If Not MemStream is Nothing then
' No 2nd exception thrown here
MemStream.Close()
End If
If Not CrypStream is Nothing then
' Exception thrown a 2nd time
CrypStream.Close()
End If
Has anyone else experienced the above?
If so, how to address the problem or is this a bug?
TC,
Do you experience the same problem when you use "Using-End Using"
statement instead of Try-Catch for CryptoStream object?
Thanks,
Onur Güzel- Hide quoted text -
- Show quoted text -
Hi,
If it solves your problem, it's OK, however you can also try to put
try-catch inside Using-End Using without "Finally" because "Using-End
Using" does all the disposal operation:
MyFunction(ByVal encryptString as String) as String
Using(MyCryptoStream)
Try
' Do Crypto tasks
return MyEncryptedString
Catch ex as CryptographicException
HandleCryptoException ex
' The 'Using' block will dispose of any CryptoStream
resources
End Using
End Function
Thanks,
Onur Güzel

TC,
To make sure that all of your disposable resources are disposed
clearly by Using statement, you can also use seperate "Using"s for
each disposable object like:

Using block1 As New DisposableObject1
'Statements here
End Using

Using block2 As New DisposableObject2
'Statements here
End Using

and so on...

Better ideas may exist of course.

Thanks,

Onur Güzel
However, as addition:
I tried nesting "Using"s and seems to work in VB.NET also:

Like:

Using w1 As IO.StreamWriter = IO.File.CreateText("c:\foo1.txt")
' code here
w1.Write("foo1")
Using w2 As IO.StreamWriter = IO.File.CreateText("c:\foo2.txt")
w2.Write("foo2")
End Using
End Using

Thanks,

Onur Güzel
Jun 27 '08 #9
In VB you can nest the Usings, or you can:

Using obj1 As New SomeObj1, obj2 As New SomeObj2, obj3 As New SomeObj3
...
End Using

On Tue, 20 May 2008 09:35:49 -0400, "TC" <ge**********@yahoo.com>
wrote:
>Hey Onur,

Perhaps better said, in C#, one can do something like the following:

Using (object1, object2, object 3)
// Perform tasks
End Using

Is there a syntax for something similar in VB.Net or does one have to nest
the 'Using' statements like this:

Using (object1)
Using(object2)
// Perform tasks
End Using
End Using

Thanks,

TC

"kimiraikkonen" <ki*************@gmail.comwrote in message
news:72**********************************@r66g200 0hsg.googlegroups.com...
On May 19, 1:10 pm, "TC" <getmyemai...@yahoo.comwrote:
>Hey Onur,

So you would recommend something like the following:

MyFunction(ByVal encryptString as String) as String
Try
Using(MyCryptoStream)
' Do Crypto tasks
return MyEncryptedString
End Using
Catch ex as CryptographicException
HandleCryptoException ex
Catch ex as Exception
HandleException(ex)
return Nothing
Finally
If Not MyMemoryStream Is Nothing Then
MyMemoryStream.Close
End If
' Do not close CryptoStream here as it causes duplicitous
exception
' The 'Using' block will dispose of any CryptoStream resources
End Function

The above does not cause the duplicitous exception to be thrown.

Thanks,

Todd

"kimiraikkonen" <kimiraikkone...@gmail.comwrote in message

news:e7**********************************@a23g200 0hsc.googlegroups.com...
On May 18, 7:36 pm, "TC" <getmyemai...@yahoo.comwrote:


Hey All,
I posted this to the Crypto users group and forgot to add the VB.Net
users
group. I apologize for any confusion.
I have been testing a try / catch / finally block and purposely raising
exceptions and I've noticed that if an exception of "Length of the data
to
decrypt is invalid." is raised with the CryptoStream object, later this
exception will get raised a second time and thrown to the caller when
trying
to close the stream in a Finally block.
For example:
Try
' Do tasks that cause CryptoStream to throw invalid length while
decrypting
Catch ex as CryptographicException
' Handle exception here
Finally
If Not MemStream is Nothing then
' No 2nd exception thrown here
MemStream.Close()
End If
If Not CrypStream is Nothing then
' Exception thrown a 2nd time
CrypStream.Close()
End If
Has anyone else experienced the above?
If so, how to address the problem or is this a bug?

TC,
Do you experience the same problem when you use "Using-End Using"
statement instead of Try-Catch for CryptoStream object?

Thanks,

Onur Güzel- Hide quoted text -

- Show quoted text -

Hi,
If it solves your problem, it's OK, however you can also try to put
try-catch inside Using-End Using without "Finally" because "Using-End
Using" does all the disposal operation:
MyFunction(ByVal encryptString as String) as String

Using(MyCryptoStream)
Try
' Do Crypto tasks
return MyEncryptedString

Catch ex as CryptographicException
HandleCryptoException ex
' The 'Using' block will dispose of any CryptoStream
resources
End Using
End Function
Thanks,

Onur Güzel
Jun 27 '08 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by RepStat | last post: by
2 posts views Thread by Alex | last post: by
23 posts views Thread by VB Programmer | last post: by
26 posts views Thread by Grim Reaper | last post: by
3 posts views Thread by Arnaud Diederen | last post: by
13 posts views Thread by Jon Davis | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.