Este método valida un número de CUI / DPI de Guatemala. Se basa en la implementación Java del siguiente blog http://xcodegt.blogspot.com/2016/09/funcion-para-validar-cui-guatemala-con.html Se actualizó el dato del número de municipios por departamento, ya que ha variado desde 2016 (fecha del post original) a la fecha. 1: private static bool ValidarDPI(string dpi) 2: { 3: var regex = "^[0-9]{4}-[0-9]{5}-[0-9]{4}$"; 4: var test = Regex.IsMatch(dpi, regex); 5: 6: if (!test) 7: { 8: return false; 9: } 10: 11: var cui = dpi.Replace("-", ""); 12: 13: var numero = cui.Substring(0, 8); 14: 15: 16: var depto = Convert.ToInt32(cui.Substring(9, 2)); 17: var muni = Convert.ToInt32(cui.Substring(11, 2)); 18: 19: var validador = Convert.ToInt32(cui.Substring(8, 1)); 20: 21: // Conteo de municipios por departamento 22: int[] munisPorDepto = 23: { 24: ...
En la documentación de ArcGIS Runtime SDK for .NET (versión de SDK 100.3.0), se encuentran ejemplos sobre autenticación y sobre consultas a un Feature Layer público, sin embargo, no encontré un ejemplo sobre una consulta a un Feature Layer privado (requiere autenticación), lo que me tomó algunas horas realizar. Comparto el ejemplo realizado (app de consola): Program.cs using System ; using Esri.ArcGISRuntime.Data ; using System.Collections.Generic ; namespace arcgisAuthTest { class Program { static void Main ( string [ ] args ) { string serviceUrl = "https://services6.arcgis.com/FFF6MrlVn5PAw2F8/arcgis/rest/services/service_bf963161c24047259028034xxxxxx/FeatureServer/0" ; // Would be better to read them from a secure source ...