void TrackGetWeatherEvent() { var eventDictionaryHockeyApp = new Dictionary <string, string> { { "Use GPS Enabled", UseGPS.ToString() } }; try { if (!Temp.Contains(_errorMessage)) { var locationCityName = UseGPS ? Condition?.Substring(0, Condition.IndexOf(":", StringComparison.Ordinal)) : Location; eventDictionaryHockeyApp.Add("Location", locationCityName); } } catch (Exception ex) { HockeyappHelpers.Report(ex); } finally { HockeyappHelpers.TrackEvent("Weather Button Tapped", eventDictionaryHockeyApp, null); } }
public int RetornoCorrimientoCifrado(IFormFile CifradoCorrimiento) { int LLaveResultante = 0; string Temp; char[] Removedor = null; string[] Receptor = null; using (var Lectura = new StreamReader(CifradoCorrimiento.OpenReadStream())) { var CapturarArchivo = new StringBuilder(); while (Lectura.Peek() >= 0) { CapturarArchivo.AppendLine(Lectura.ReadLine()); } Temp = CapturarArchivo.ToString(); Removedor = Temp.ToCharArray(); Receptor = new string[Removedor.Length - 2]; for (int i = 0; i < Removedor.Length - 2; i++) { Receptor[i] = Removedor[i].ToString(); } Temp = String.Concat(Receptor); if (Temp.Contains("\r\n")) { Temp = Temp.Replace("\r\n", "\n"); } Lectura.Close(); } LLaveResultante = Convert.ToInt32(Temp); return(LLaveResultante); }
/// <summary> /// metodo que procede a quitar caracteres innecesarios al momento de leer el archivo /// </summary> /// <param name="ArchivoEntrada">Archivo ingresado desde la API</param> /// <returns></returns> private char[] ReduccionArchivo(IFormFile ArchivoEntrada) { string Temp; char[] TextoResultante = null; char[] Removedor = null; string[] Receptor = null; using (var Lectura = new StreamReader(ArchivoEntrada.OpenReadStream())) { var CapturarArchivo = new StringBuilder(); while (Lectura.Peek() >= 0) { CapturarArchivo.AppendLine(Lectura.ReadLine()); } Temp = CapturarArchivo.ToString(); Removedor = Temp.ToCharArray(); Receptor = new string[Removedor.Length - 2]; for (int i = 0; i < Removedor.Length - 2; i++) { Receptor[i] = Removedor[i].ToString(); } Temp = String.Concat(Receptor); if (Temp.Contains("\r\n")) { Temp = Temp.Replace("\r\n", "\n"); } TextoResultante = Temp.ToCharArray(); Lectura.Close(); } return(TextoResultante); }
public void CacheExistingIndexes(CachedIndexTypes cit) { if (cit == CachedIndexTypes.CIT_PaypalSales) { CachedIndexes.Clear(); SQLiteConnection m_dbConnection = GlobalVariables.DBStorage.GetConnection(); var cmd1 = new SQLiteCommand(m_dbConnection); cmd1.CommandText = "SELECT TransactionID_hash,TransactionID FROM PAYPAL_SALES"; cmd1.Prepare(); SQLiteDataReader rdr = cmd1.ExecuteReader(); while (rdr.Read() && rdr.HasRows == true) { if (!rdr.IsDBNull(1)) { int CurHash = rdr.GetInt32(0); List <string> Temp; CachedIndexes.TryGetValue(CurHash, out Temp); string NewIndex = rdr.GetString(1); if (Temp != null && Temp.Contains(NewIndex)) { continue; } AddRow(CurHash, NewIndex); } } } }
private char[] VerificacionCadena(IFormFile Archivo, int TamañoCarril) { char[] TextoCompleto = null; char[] Resultante = null; char[] Removedor = null; string[] Receptor = null; string Temp; double ElementosOla = ((TamañoCarril * 2) - 2); double Olas = 0; int TempNumerico = 0; using (var Lectura = new StreamReader(Archivo.OpenReadStream())) { var CapturarArchivo = new StringBuilder(); while (Lectura.Peek() >= 0) { CapturarArchivo.AppendLine(Lectura.ReadLine()); } Temp = CapturarArchivo.ToString(); Removedor = Temp.ToCharArray(); Receptor = new string[Removedor.Length - 2]; for (int i = 0; i < Removedor.Length - 2; i++) { Receptor[i] = Removedor[i].ToString(); } Temp = String.Concat(Receptor); if (Temp.Contains("\r\n")) { Temp = Temp.Replace("\r\n", "\n"); } TextoCompleto = Temp.ToCharArray(); } Olas = TextoCompleto.Length / ElementosOla; if (Olas % 1 != 0) { double resulado1 = ((Olas % 1) - 1) * -1; Olas = Olas + resulado1; Resultante = new char[Convert.ToInt32(Olas * ElementosOla)]; for (int i = 0; i < TextoCompleto.Length; i++) { Resultante[i] = TextoCompleto[i]; } //double resulado = ((Olas % 1)-1)*-1; //Olas = Olas + resulado; TempNumerico = ((Convert.ToInt32(Olas * ElementosOla)) - 1); for (int i = TempNumerico - 1; i < Olas * ElementosOla; i++) { Resultante[i] = '#'; } } else { Resultante = TextoCompleto; } return(Resultante); }
private void GetDriveInfo() { startGetDriveFile = true; DriveInfotemp.AddRange(new DriveInfo(BindataPath).EnumerateFiles().ToArray()); foreach (var Temp in DriveInfotemp.Where(Temp => Temp.Contains(BindataPath))) { DriveFile.Add(Temp); } startGetDriveFile = false; }
public bool CheckRowExists(int Hash, string Index) { List <string> Temp; if (CachedIndexes.TryGetValue(Hash, out Temp) == false) { return(false); } if (Temp.Contains(Index)) { return(true); } return(false); }
public int[] RetornoLLaves(IFormFile ArchivoLLaves) { int[] LLaveResultantes = null; string[] LLavesRString = null; string Temp; char[] TextoResultante = null; char[] Removedor = null; string[] Receptor = null; using (var Lectura = new StreamReader(ArchivoLLaves.OpenReadStream())) { var CapturarArchivo = new StringBuilder(); while (Lectura.Peek() >= 0) { CapturarArchivo.AppendLine(Lectura.ReadLine()); } Temp = CapturarArchivo.ToString(); Removedor = Temp.ToCharArray(); Receptor = new string[Removedor.Length - 2]; for (int i = 0; i < Removedor.Length - 2; i++) { Receptor[i] = Removedor[i].ToString(); } Temp = String.Concat(Receptor); if (Temp.Contains("\r\n")) { Temp = Temp.Replace("\r\n", "\n"); } TextoResultante = Temp.ToCharArray(); Lectura.Close(); LLavesRString = Temp.Split(','); LLaveResultantes = new int[LLavesRString.Length]; for (int i = 0; i < LLavesRString.Length; i++) { LLaveResultantes[i] = Convert.ToInt32(LLavesRString[i]); } } return(LLaveResultantes); }
private char[] VerificacionCadena(IFormFile Archivo, int LongitudLlave) { char[] TextoCompleto = null; char[] Resultante = null; string Temp; using (var Lectura = new StreamReader(Archivo.OpenReadStream())) { var CapturarArchivo = new StringBuilder(); while (Lectura.Peek() >= 0) { CapturarArchivo.AppendLine(Lectura.ReadLine()); } Temp = CapturarArchivo.ToString(); if (Temp.Contains("\r\n")) { Temp = Temp.Replace("\r\n", "\n"); } TextoCompleto = Temp.ToCharArray(); } return(Resultante); }