|
You don't mention at all what your problem is, so it is kind of hard to know how to help.
Are you getting an error message? An exception?
Ben
|
|
|
|
|
--------------------------------------------------------------------
TrustFailure - The underlying connection was colsed : could not estabilsh trust relashionship for SSL/TLS secure channel
--------------------------------------------------------------------
Palestine
|
|
|
|
|
Ok I missed that the second url was https:.
I haven't actually done this with a Httpwebrequest object, but looking at the documentation it looks like you need to add a client certificate.
Here is the MS help:
An application can add a certificate to a collection, but might not have access rights to it. To use a certificate contained in the collection, the application must have the same access rights as the entity that issued the certificate.
Note
The Framework caches SSL sessions as they are created and attempts to reuse a cached session for a new request, if possible. When attempting to reuse an SSL session, the Framework uses the first element of ClientCertificates (if there is one), or tries to reuse an anonymous sessions if ClientCertificates is empty.
Note
For performance reasons, you shouldn't add a client certificate to a HttpWebRequest unless you know the server will ask for it.
For a code example illustrating how to enumerate the certificates in the client certificate store, see the X509Certificate2Collection class.
Ben
|
|
|
|
|
main problem who can open untrust site with HttpWebRequest ??
Palestine
|
|
|
|
|
the see this error message
--------------------------------------------------------------------
TrustFailure - The underlying connection was colsed : could not estabilsh trust relashionship for SSL/TLS secure channel
--------------------------------------------------------------------
Palestine
|
|
|
|
|
You don't need to put the same question in multiple forums.
__________________
Bob is my homeboy.
|
|
|
|
|
I have the following interface
public interface IImage
{
string FileName { get; set;}
string Caption { get; set;}
} I have a class called Image that implements the interface.
I create a BindingList of that Image object:
BindingList<Image> images = new BindingList<Image>(); I later want to store images in a list defined as the interface.
BindingList<IImage> = images; Why am I getting a casting error? If I understand the rules of polymorphisms correctly, so long as my Image class implements IImage, I can store any Image as an IImage without needing to explicitly cast.
What to do?
-Mike.
|
|
|
|
|
MBursill wrote: BindingList<iimage> = images; // casting error
Why am I getting a casting error? If I understand the rules of polymorphisms correctly, so long as my Image class implements IImage, I can store any Image as an IImage without needing to explicitly cast.
See, as per polymorphisms you asign a object of the drived class to a base class. But in the above case the "BindingList<iimage>" is not a base class to the "BindingList", hence you are not able to assign them. Its actually the items they contains have relation of base class - drive class.
Manoj
Never Gives up
|
|
|
|
|
MBursill wrote: BindingList images = new BindingList();
Do the following
BindingList<IImage> images = new BindingList<IImage>();
|
|
|
|
|
hi,
Can you help me ?
c # directory file version and configuration version and product version as information how reader ?
I can't find
Thanks
hi
|
|
|
|
|
Hi,
1) If you want to know the Operating System Information, here is the code:
System.OperatingSystem OperatingSysInfo = System.Environment.OSVersion;
2) If you want to know the Platform, you can get it from
OperatingSysInfo.PlatForm enumrator.
similarly you can check for many information in the object of the OperatingSystem.
Manoj
Never Gives up
|
|
|
|
|
Good Morning ,
Thanks.But I want not operating system read information , I want cd , floppy disk , network , partion(C,D) whichever one (folders , file) reader (product version, file version , configuration version) information ..
Can you help me ?
Thanks .
hi
|
|
|
|
|
Hi,
You can use the DirectoryInfo class to get the info of the drvie and folder and even files.
Manoj
Never Gives up
|
|
|
|
|
hi,
Yes , I can use the directory whichever file version and product version knife information ...
can you give me e-mail address? detail some formation tell
thanks
hi
|
|
|
|
|
Even after reading lots of articles about dispose, I still have some very annoying doubts...
For instance, a have an application that makes intence use of userControls. This user controls encapsulates a lot a Windows Forms Controls, and a COM object.
Doubts:
- Do I have to call dispose for every Windows Forms Controls in my UserControl's dispose?
- I've been told to use System.Runtime.InteropServices.Marshal.ReleaseComObject() to free the resources of my COM object. Is that necessery?
- I know that I shold dispose any bitmaps loaded. Does that means that I need to dispose an image of a picturebox, like picturebox1.image.dispose()? Or simply calling picturebox1.dispose() will do the job?
- What else do I need to dispose anyway? My userControl has a few arrays of strings, Colors and Images. I'm only disposing the images.
Thanks a lot
Peterson
|
|
|
|
|
I tend to rather reuse disposable objects than creating/disposing them, IMO if you dont use it frequently and seeing bad effects, then you dont have to worry about it.
|
|
|
|
|
Hello,
Here is what I know (or think to know) about disposing.
peterson@brfree.com.br wrote: Do I have to call dispose for every Windows Forms Controls in my UserControl's dispose?
No, If your UserControl is member of a parent which will be Disposed, it will automaticaly be called.
Lets say your UserControl is placed on an Windows.Form (So your Control is member of the ControlsCollection of the Form) and you call the Form.Close() method (which calls Dispose internal) you don't have to call Dispose of your Control.
If your Control is a member Variable which is removed from ControlsCollection during runtime , you will definitely have to Dispose your UserControl. But not the Controls which are Placed on the UserControl seperitaly (In fact, if they also are placed in the ControlsCollection of the UserControl).
peterson@brfree.com.br wrote: I've been told to use System.Runtime.InteropServices.Marshal.ReleaseComObject() to free the resources of my COM object. Is that necessery?
Sorry, Don't have information about that.
peterson@brfree.com.br wrote: I know that I shold dispose any bitmaps loaded. Does that means that I need to dispose an image of a picturebox, like picturebox1.image.dispose()? Or simply calling picturebox1.dispose() will do the job?
Same here, if your PictureBox is member of a ControlsCollection, you don't have to do so.
And you deffinitely don't have to dispose the "picturebox1.image".
But if you are changing the Image on runtime you will have to do so, before you add the new image.
peterson@brfree.com.br wrote: What else do I need to dispose anyway? My userControl has a few arrays of strings, Colors and Images. I'm only disposing the images.
As string and Color are not IDisposable members you will not be able to dispose them.
You should think of calling dispose, allways if you instanciate something new, because there could be a old instance of some class which has no more reference to your class and is not disposed, whcih will cause a memory leak.
What's also very important apart from calling dispose, is what you are doing in your Dispose method of your UserControl.
for example the disconnection of delegate (eventhandler)
I'm using the .Net Memoryprofiler for the analysis of my project:http://memprofiler.com/[^]
Hope it helps!
All the best,
Martin
|
|
|
|
|
Thanks for your quick answer, it helped a lot.
I'm also using a memory profiler. And I see a lot of objects listed as undisposed items. That means items that have been collected by the garbage colector whitout beeing properly disposed. This objects are Labels, Buttons, TextBox, Fonts and a few others.
I'm worried if this could cause a problem later, because my application is supposed to run 24/7.
When you say to disconnect a delegate in the dispose method, that includes even the delegates generated by visual studio, like the delegate for a click event of a button?
Peterson
|
|
|
|
|
Hello,
peterson@brfree.com.br wrote: When you say to disconnect a delegate in the dispose method, that includes even the delegates generated by visual studio, like the delegate for a click event of a button?
Good question!
The answer is no!
What you have to worry about is for instance:
You have an Usercontrol.
You have an UserManagementclass which provides an event, lets say "StatusChanged".
At startup you instanciate your management class once. This class will always be in memory till you end the program.
Then your Form will be instanciated with your UserControls on it.
This Usercontrols are getting a reference to this Managementclass in the constructor and connect the event StatusChanged (mymanagementclass.StatusChanged+=...).
In that case your UserControls Dispose method has to implement "mymanagementclass.StatusChanged-=...", otherways there would always be the reference to the Management class and the GC could not free the UserControls memory.
What you also can do to help the GC finding not referenced objects is setting them null after disposing.
In my example you could add "mymanagementclass=null" in the Dispose method of your UserControl.
peterson@brfree.com.br wrote: And I see a lot of objects listed as undisposed items. That means items that have been collected by the garbage colector whitout beeing properly disposed. This objects are Labels, Buttons, TextBox, Fonts and a few others. I would also be worried about that!
Looks like you are not Close() complete Forms which are shown with Show(), and always instanciate a new Form.
Is it possible that you are doing so?
Hope it helps!
All the best,
Martin
|
|
|
|
|
I close the forms, for sure... It's wierd... between the undisposed items it keeps acumulating 3 types of my userControls. The project has 7 other types of userControls that seems to be diposing Ok.
And this userControls that are not beeing properly disposed have labels and buttons in them. I believe that this may be the cause of the labels and buttons undisposed in the profiler's list.
I have left the application running for several hours, using DataLoad to keep openning and closing screens. Even though Memory Profiler shows an increase in theses undisposed items, the memory used by the application remains in 100MB - 120MB (reported by task manager). So it doesn't seems to have a leak, like the profiler sais. I don't know if I can trust 100% on the profiler. It´s documentation is not very clear in some poits...
Peterson
|
|
|
|
|
Hello,
Peterson Luiz wrote: And this userControls that are not beeing properly disposed have labels and buttons in them
Is there something else special about that UserControl?
Peterson Luiz wrote: Even though Memory Profiler shows an increase in theses undisposed items, the memory used by the application remains in 100MB - 120MB (reported by task manager).
Maybe the GC is able to free these memory although it is not disposed properly, who knows?;)
Peterson Luiz wrote: I don't know if I can trust 100% on the profiler. It´s documentation is not very clear in some poits...
That's true, but normaly it shows always too much because it also calculating the unmanaged resorces.
At the link I gave you, you could download a trial version of .netmemprofiler professional, which also shows the unmanaged resorces apart from .Net recorses!
I would recommend making snapshots from time to time and look for delta instances!
All the best,
Martin
|
|
|
|
|
peterson@brfree.com.br wrote: I've been told to use System.Runtime.InteropServices.Marshal.ReleaseComObject() to free the resources of my COM object. Is that necessery?
Yes!
|
|
|
|
|
Hello
I want to share a folder through coding, within a network.
Thanks
Devesh Mishra
|
|
|
|
|
Hi,
You can use the "SetAccessControl" method of the DirectoryInfo class for this purpose.
Manoj
Never Gives up
|
|
|
|
|
I have a table of data 'properties' containing
PropertyID int ident,
PropertyName varchar,
PropertyRequired bit,
PropertyType varchar,
PropertyValue varchar
I'm looking to create a BLL with a class MyProperties and an enum MyPropertyTypes
The MyPropertyTypes are Number, Text, Date, Boolean, ListFixed, ListCustom, Range
For the Number,Text,Date,Boolean only a single value is present but for the rest they can have more than one value
what is the best way to model a class/es to incorporate the properties common to all (ID, Name, Required, Type) and the properties specific to each PropertyType which can vary by both number and object type?
Thanks in advance
Mac.
|
|
|
|
|