Author Archives: Everton Gonçalves

About Everton Gonçalves

http://www.ctasoftware.com.br

Como instalar e desinstalar serviços no Windows

Para instalar os serviços criados através do seu Visual Studio você poderá utilizar o installutil que está instalado na pasta do FrameWork. Para acessar o InstallUtil você deve abrir seu Prompt de Comando (cmd) e acessar o caminho do FrameWork que foi desenvolvido o serviço, exemplo: No caso do FrameWork 4.0 o arquivo deve estar em C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe […]

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> .NET | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> , , , , , | Leave a comment

Listar Todas Base de Dados da instância SQL Server

Para exibir uma lista de bancos de dados em uma instância do SQL Server Conecte-se a instância de Banco de Dados. Na barra Padrão, clique em Nova Consulta ou New Query. Copie e cole o exemplo a seguir na janela de consulta e clique em Executar. Este exemplo retorna uma lista dos bancos de dados na instância do […]

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> SQL | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> | Leave a comment

Metodo Escrever em Arquivo Texto C#

Olá, Abaixo um método básico para escrever em arquivo texto em C# public void escreveArquivo(string dados) { string nome_arquivo = “C:/Temp/arquivo.txt”; if (!System.IO.File.Exists(nome_arquivo)) System.IO.File.Create(nome_arquivo).Close(); System.IO.TextWriter arquivo = System.IO.File.AppendText(nome_arquivo); arquivo.WriteLine(dados); arquivo.Close(); }

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> .NET | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> | Leave a comment

Alterar Texto do Toolbar do SharePoint com JQuery

Vezes necessitamos alterar algum texto de nossa Toolbar do SharePoint nativo ou por linguagem, etc. No meu caso tinha uma toolbar personalizada e não gostaria de fazer o deploy novamente, também tive a necessidade de alterar a depender da linguagem selecionada, por tal motivo, utilizei do JQuery para realizar a alteração. $(“ie\\:menuitem[text=’Mudar Senha’]”).attr(“text”, “Change Password”); […]

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> SharePoint | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> , | Leave a comment

Alterar Texto SPAN com JQuery

Lê a página e altera o SPAN que tem title ‘Open Menu’ para ‘My Action 2′. Muito útil e rápido $(document).ready(function(){ $(“SPAN[title=’Open Menu’] A”).text(“My Actions 2”); });

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> .NET, SharePoint | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> , , | Leave a comment

C# Obter todos os usuários AD

Abaixo o código para obter todos os usuários do Active Directory (AD) do windows. Além de printar na tela ele insere em um arquivo texto. public void ObterUsuarioAD() { DirectoryEntry entry = new DirectoryEntry(“LDAP://SERVIDOR-AD”); DirectorySearcher dSearch = new DirectorySearcher(entry); dSearch.PageSize = 10000; dSearch.SizeLimit = 10000; dSearch.Filter = “(&(objectClass=user))”; // get all entries from the active […]

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> .NET | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> | Leave a comment

C# – Pegar todos usuarios cadastrado no AD

Em uma necessidade que tive de obter todos os usuários do AD, fiz algumas pesquisas no GOOGLE e encontrei uma boa referência e um código fácil de entender.   using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.DirectoryServices; using System.DirectoryServices.AccountManagement; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { string groupName = […]

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> .NET | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> , | Leave a comment

C# – Criar e escrever em um arquivo txt

Vamos escolher onde criar o arquivo e qual nome daremos a ele. string nomeArquivo = “C:/Temp/Arquivo.txt”; Se o arquivo não existir criamos o arquivo com o seguinte comando abaixo: if (!System.IO.File.Exists(nomeArquivo)){ System.IO.File.Create(nomeArquivo).Close(); } Com a classe TextWriter escrevemos no arquivo. System.IO.TextWriter arquivo = System.IO.File.AppendText(nomeArquivo); arquivo.WriteLine(“Teste de escrita no arquivo”); Fechamos o arquivo: arquivo.Close(); Até a […]

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> .NET | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> , | Leave a comment

Criando e chamando procedure MySQL

Sintaxe da criação de uma procedure no MySQL DELIMITER $$ DROP PROCEDURE IF EXISTS `total_alunos` $$ CREATE PROCEDURE `total_alunos` () BEGIN SELECT COUNT(*) FROM alunos; END $$ DELIMITER ; Para chamar através do PHP ou Query basta executar o call total_alunos() Simples e prático 🙂

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> MySQL | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> , | Leave a comment

Renomear Tabela MySQL

Prezados, As vezes sentimos a necessidade de renomear uma tabela que já está em produção. Vezes por ser case sensitive ou por motivos diversos. Facilmente poderemos renomear da seguinte forma: RENAME TABLE tabela1 TO tabela2; Abraço a todos.

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> MySQL | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> | Leave a comment