C # Check the standard image number,

Source: Internet
Author: User

C # Check the standard image number,

/// <Summary> /// check whether the image is a standard image number /// </summary> /// <param name = "MapNumber"> Image number </param>/ // <returns> check result True/false </returns> private bool CheckMapNumber (string MapNumber) {int ColumnNumber100; if (MapNumber. length = 3) // graph Size Rule {Regex RegMapNumber = new Regex (@ "^ [A-S] \ d $"); if (RegMapNumber. isMatch (MapNumber. toUpper () {ColumnNumber100 = Convert. toInt32 (MapNumber. substring (1, 2); if (ColumnNumber100 <= 60) {return true ;}} if (MapNumber. length = 10) // other image frame rules {string ScaleMark = ""; int ColumnNumber; int RowNumber; int RowMax = 0; int ColumnMax = 0; regex RegMapNumber = new Regex (@ "^ [A-S] \ d [B-H] \ d $"); if (RegMapNumber. isMatch (MapNumber. toUpper () {ScaleMark = MapNumber. substring (3, 1); switch (ScaleMark) {case "B": RowMax = 2; ColumnMax = 2; break; case "C": RowMax = 4; ColumnMax = 4; break; case "D": RowMax = 12; ColumnMax = 12; break; case "E": RowMax = 24; ColumnMax = 24; break; case "F ": rowMax = 48; ColumnMax = 48; break; case "G": RowMax = 96; ColumnMax = 96; break; case "H": RowMax = 192; ColumnMax = 192; break; default: RowMax = 0; ColumnMax = 0; break;} ColumnNumber100 = Convert. toInt32 (MapNumber. substring (1, 2); RowNumber = Convert. toInt32 (MapNumber. substring (4, 3); ColumnNumber = Convert. toInt32 (MapNumber. substring (7, 3); if (ColumnNumber100 <= 60 & RowNumber <= RowMax & ColumnNumber <= ColumnMax) {return true ;}} return false ;}

  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.