0

What i'm doing here is checking the source code of a webpage for <input fields, the code is pretty basic:

Code:

                        foreach (string key in keys)
                        {
                            if (pageHtml.Contains("name=\"" + key + "\""))
                            {
                                // Ignore fields that are hidden ...

                                // Add it to the list ...
                                found.Add(key + "|" + value);

                                // Log ...
                                Log.Add("Found [F] -> [ " + key + " ] -> [ " + value + " ] ...");
                            }
                        }

With the code i am able to check if name="VALUE" exists, I have a small issue in my software that if a field is like <input type="hidden" name="do" value="VALUE" /> a hidden field i'm hitting an error, I'm thinking i need to extract the entire line then check if it contains "hidden" before adding to the list, I cannot think of the best way to extract the entire <input line before checking, I'm assuming i'll need regex, any help would be appreciated.

tess
  • 29
  • 5

0 Answers0