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
My web Application include a lot of .cs page. Sometimes, they call each other. Is there any methods to find out all the name of the executed pages when we browse one page. There are the same base class and different page name for each page.
I'd like to attach to winmm.dll from C# (VS2005) and translated a few DLLImports from a very old VB6-Code i found on the internet. Some methods have callbacks and i don't know how to translate them.
The methods look like this:
public static extern int midiInOpen(ref int lphMidiIn, int uDeviceID, int dwCallback, int dwInstance, int dwFlags);
public void MidiIN_Proc(long hmIN, long wMsg, int dwInstance, int dwParam1, int dwParam2)
The method should somehow work like this:
midiInOpen(ref hMidiIN, mMPU401IN, <callback> 0, CALLBACK_FUNCTION);
The problem is, that in the original version dwInstance and dwCallback are pointers to methods. Unfortunately i have no clue how to use these DLL-calls in C#.
Can anybody tell me how to do these DLL-calls or provide some example-code=