This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class Util | |
| { | |
| public static string RemoveAcentos(string palavra) | |
| { | |
| string palavraSemAcento = null; | |
| string caracterComAcento = "áàãâäéèêëíìîïóòõôöúùûüçÁÀÃÂÄÉÈÊËÍÌÎÏÓÒÕÖÔÚÙÛÜÇ"; | |
| string caracterSemAcento = "aaaaaeeeeiiiiooooouuuucAAAAAEEEEIIIIOOOOOUUUUC"; | |
| for (int i = 0; i < palavra.Length; i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /****** Object: UserDefinedFunction [dbo].[UperFirst] Script Date: 10/30/2012 15:27:56 ******/ | |
| SET ANSI_NULLS ON | |
| GO | |
| SET QUOTED_IDENTIFIER ON | |
| GO | |
| -- ============================================= | |
| -- Author: <Author,,Name> | |
| -- Create date: <Create Date, ,> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public string GetHashFromFile(string localDoArquivo) | |
| { | |
| using (HashAlgorithm hashAlgorithm = HashAlgorithm.Create("SHA1")) | |
| { | |
| using (Stream stream = new FileStream(localDoArquivo, FileMode.Open, FileAccess.Read)) | |
| { | |
| byte[] hash = hashAlgorithm.ComputeHash(stream); | |
| return BitConverter.ToString(hash); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use DBNAME | |
| go | |
| declare @id int -- The object id that takes up space | |
| ,@type character(2) -- The object type. | |
| ,@pages bigint -- Working variable for size calc. | |
| ,@dbname sysname | |
| ,@dbsize bigint | |
| ,@logsize bigint | |
| ,@reservedpages bigint |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| o.name as 'TableName' , | |
| SUM ( | |
| CASE | |
| WHEN (index_id < 2) THEN row_count | |
| ELSE 0 | |
| END | |
| ) as 'RowCount', | |
| LTRIM (STR (SUM (reserved_page_count)/1024 * 8, 15, 0) + ' MB') as'Reserved MB', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --DBCC TRACEON(8666) | |
| --GO | |
| SELECT qt.text [Comando], | |
| CP.usecounts [Qtd Executado], | |
| cp.size_in_bytes [TamanhoBytes], | |
| cp.objtype [TipoConsulta], | |
| qp.query_plan [ExecutionPlan] | |
| FROM sys.dm_exec_cached_plans cp | |
| CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) qp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.Web.Deployment; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| namespace DemoDeploy | |
| { | |
| class Program | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| netsh interface ip set address name="Local Area Connection" static ipadress networkmask gatewaydefault 1 | |
| netsh interface ip set dnsserver name="Local Area Connection" static xxx.xxx.xxx.xxx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Web; | |
| using System.Web.Mvc; | |
| namespace MvcApplication1.Controllers | |
| { | |
| [HandleError] | |
| public class HomeController : Controller |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| net user usuarionome senhaa /add | |
| net user usuarionome senhaa | |
| WMIC USERACCOUNT WHERE "Name='usuarionome'" SET PasswordExpires=FALSE | |
| net localgroup administrators usuarionome /add |