Message
Message
Win32;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using connectWeb;
using System.Collections;
using System.Security.Cryptography.X509Certificates;
using System.Data.Odbc;
using Grafiki245Plus;
namespace connectWeb
{
public class Program
{
[DllImport("odbc32.dll")]
internal static extern int SQLDataSources(int EnvHandle, int Direction,
StringBuilder ServerName, int ServerNameBufferLenIn, ref int
ServerNameBufferLenOut, StringBuilder Driver, int DriverBufferLenIn, ref int
DriverBufferLenOut);
[DllImport("odbc32.dll")]
internal static extern int SQLAllocEnv(ref int EnvHandle);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
case "carregaBasesCriarTopico":
CarregaDataSources();
escritor.WriteLine(@"<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML
1.0 Strict//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"">
<html xmlns=""http://www.w3.org/1999/xhtml"" xml:lang=""pt-BR""
lang=""pt-BR"">
<head>
<meta charset=""utf-8"" />
<meta http-equiv=""Content-Type"" content=""text/html""/>
<title>Connect Web - Bem Vindo!</title>
<style>
</style>
</head>
<body>
<select>");
foreach (var item in arrayDataSources)
{
escritor.WriteLine($"<option>{item}</option>");
}
escritor.WriteLine("</select></body></html>");
escritor.Close();
break;
}
/*CarregaDataSources();
foreach(string baseOdbc in arrayDataSources)
{
escritor.WriteLine($" < option value=opcao> {baseOdbc} </option>");
escritor.Close();
}*/
Application.Exit();
}
static void LePedido2()
{
try
{
StreamReader literal = new StreamReader("C:\\Program Files(x86)\\
Lab245\\Softwares\\ConnectManagerWeb\\" + argumentos[0].Replace(".\\", ""));
StreamWriter saida = new StreamWriter("C:\\Program Files(x86)\\
Lab245\\Softwares\\ConnectManagerWeb\\" + argumentos[2].Replace(".\\", ""));
StreamReader external = new StreamReader("C:\\Program Files(x86)\\
Lab245\\Softwares\\ConnectManagerWeb\\" + argumentos[1].Replace(".\\", ""));
//Read the first line of text
//TrataLog.EscreveLog("[LePedido.cs > LePedido2] Caminho do arquivo
de entrada: " + "C:\\Program Files(x86)\\Lab245\\Softwares\\ConnectManagerWeb\\" +
EstruturaDados.argumentos[0].Replace(".\\", ""), true);
//TrataLog.EscreveLog("[LePedido.cs > LePedido2] Caminho do arquivo
de saída: " + "C:\\Program Files(x86)\\Lab245\\Softwares\\ConnectManagerWeb\\" +
EstruturaDados.argumentos[2].Replace(".\\", ""), true);
//TrataLog.EscreveLog("[LePedido.cs > LePedido2] Caminho do arquivo
external: " + "C:\\Program Files(x86)\\Lab245\\Softwares\\ConnectManagerWeb\\" +
EstruturaDados.argumentos[1].Replace(".\\", ""), true);
string line2 = "";
}
string[] conteudo = File.ReadAllLines("C:\\Program Files(x86)\\
Lab245\\Softwares\\ConnectManagerWeb\\" + argumentos[0].Replace(".\\", ""));
string[] conteudoEx = File.ReadAllLines("C:\\Program Files(x86)\\
Lab245\\Softwares\\ConnectManagerWeb\\" + argumentos[1].Replace(".\\", ""));
bool controle = false;
bool controle2 = false;
for (int i = 0; i < conteudo.Length; i++)
{
if (conteudo[i] == "[Form Literal]")
{
controle = true;
}
if (conteudo[i].IndexOf('=') > 0 && controle)
{
string linha = conteudo[i].Split('=')[0].Trim().ToUpper();
string valor = conteudo[i].Split('=')[1].Trim();
Entrada.Add(linha, valor);
}
if (conteudo[i] == "[Form External]")
{
controle = false;
controle2 = true;
}
if (conteudo[i].IndexOf('=') > 0 && controle2)
{
for (int n = 0; n < conteudoEx.Length; n++)
{
line2 = external.ReadLine();
string linhaEx = conteudo[i].Split('=')
[0].Trim().ToUpper();
string valorEx = conteudoEx[n];
Entrada.Add(linhaEx, valorEx);
}
}
}
//Write a line of text
}
catch
{
}
}
static void EscrevePaginaInicial()
{
paginaInicial = @"<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0
Strict//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"">
<html xmlns=""http://www.w3.org/1999/xhtml"" xml:lang=""pt-BR""
lang=""pt-BR"">
<head>
<meta charset=""utf-8"" />
<meta http-equiv=""Content-Type"" content=""text/html""/>
<title>Connect Web - Bem Vindo!</title>
<style>
</style>
</head>
<body>
<h1>Connect Web</h1>
<div>
<button>Criar/Editar Topico</button>
<button>Capture List</button>
<button>Magali Config</button>
<button>Magali Service</button>
</div>
<div>
<ul>
<li>
<div>
<p>Nome do Tópico:</p>
<input name=""txtNomeTopico"" type=""text"" />
</div>
<div>
<p>Base:</p>
<button class""btnMostraBase""
id=""btnMostrarBase"">...</button>
<form name=""formBaseSelecionada""
action=""/connectWeb245/connectWeb.dll"" target=""basesCriarTopico"">
<input type=""hidden"" name=""processo""
value=""carregaBasesCriarTopico"" />
</form>
<iframe id=""frmBasesDisponiveis""
name=""basesCriarTopico"" style=""height:200px;width: 200px;
display:none;""></iframe>
</div>
</li>
</ul>
</div>
<script>
let frmBasesDisponiveis =
document.getElementById(""frmBasesDisponiveis"");
let btnMostrarBase =
document.getElementById(""btnMostrarBase"");
btnMostrarBase.addEventListener('click', function (){
if(frmBasesDisponiveis.style.display === 'none')
{
frmBasesDisponiveis.style.display=""flex"";
document.formBaseSelecionada.submit();
}
else
{
frmBasesDisponiveis.style.display=""none"";
}
});
</script>
</body>
</html>";
}
arrayDataSources = listaDataSources.ToArray();
}
}
catch
{
return;
}
}
else
{
}
}
}
}