this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/AllLanguages/General
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
The GlobalMemoryStatus function retrieves information about current available memory. The function returns information about both physical and virtual memory. This function supersedes the GetFreeSpace function.
P.S. For these kind of function u can use API-Guide a good software
internal Access is limited to the current assembly.
Sonia Gupta wrote:
somebody please provide any example that elaborates how to use these things.
Assume you have two class file, class1 and class2. Your class1 looks like
class2 looks like
class1 c1 = new class1(); //Will produce error
This is how internal works. You won't be able to get reference to internal class from other assembly. Try making the internal to public to get access.
Sonia Gupta wrote:
protected internal Access is limited to the current assembly or types derived from the containing class.
Protected keyword is mostly used in internal classes ( class inside other one ). It can be accessed by containing type and any type that inherits containing type. So protected internal would be protected level + internal level. I am not sure regarding this, check with online documentations.
Protected is like a private member for a class, but it's visible in derived classes also.
internal is like public but only inside the current assembly.
if you need a property that can be accessed from other classes inside your assembly and a derived class from another assembly should be able to provide a value for it, you make it
protected internal, which means public inside the current assembly and private for all the other asemblies.
let's say you have 2 assemblies the BaseClassLib and the ConsumerLib
now in the BaseClassLib you have 2 classes called ConsumerClass and ProviderClass
publicclass ConsumerClass<br />
public ConsumerClass(ProviderClass Provider)<br />
// calls the Protected internal function of any ProviderClass-derived class<br />
publicabstractclass ProviderClass<br />
protectedinternalabstractstring getProtIntVal();<br />
in the ConsumerLib you have a Reference to the ProviderLib and you have 2 classes called StartupClass and DerivedProviderClass
publicclass DerivedProviderClass:ProviderClass<br />
public DerivedProviderClass()<br />
protectedoverridestring getProtIntVal()<br />
return"this is a string";<br />
publicclass StartupClass<br />
publicstaticvoid Main(params string args)<br />
DerivedProviderClass c = new DerivedProviderClass();<br />
// Next will cause a compiler - Error<br />
// Next will work<br />
ConsumerClass cons = new ConsumerClass(c);<br />
there is some APIs which can lock keyboard/Mouse and simulate keyPress/MouseClick/MouseMove and find the Window name,position and size
but first I think you must create a map of your gui interface (like where is the button and...) and then do what you want sequentially using the APIs but before that you must lock the keyboard for preventing user interrupts.
just do some searches in codeproject and MSDN for APIs you will found them easily.
this two properties are the same child elements of the xml but have different attributes so i want to know dynamically that the property has the attribute and it's value or not dynamically in c#.net windows application