You can execute the FormCollection as follows:
foreach( string key in forms.Keys ) { ... }
However, note that the browser only sends you names and values. It does not send you input types, so you have no way to check if the value is a flag if you do not know all the flag names in advance. But if that is the case, you donโt need to go in cycles - just pull them out of the collection by name.
source share