Tuesday, August 03rd, 2010 | Author: admin

Para ver em portugues veja mais abaixo neste post

English:

I have a VPN to my work, but recently stopped working giving the error 721 when trying to Connect … I searched the net and some post talking about the port on the router or firewall, but had the firewall turned off and tested it with another computer on the same wireless network and it worked …

After much research I discovered what caused this error.
To connect to some clients I use Cisco Systems VPN Client.
The VPN Client has an option that caused the error:)
Resolution:

 

Open the Cisco VPN Client -> Options-> Deselect the option Stateful Firewall (Always on).
I tested my VPN for work (VPN windows xp) and it worked!: D
The error occurred even be having the Cisco VPN Client running ..

  Português:

Tenho uma ligação VPN para o meu trabalho, mas recentemente deixou de funcionar dando o erro 721 quando tentava connectar… Pesquisei na net e alguns post falavam sobre a porta no router ou firewall, mas tinha a firewall desligada e testei com outro computador na mesma rede wireless e funcionou..
Após muita pesquisa descobri o que causava este erro.
Para me conectar a alguns clientes eu utilizo o Cisco Systems VPN Client.
Este VPN Cliente tem uma opção que causava o erro :)

Resolução:

Abrir o Cisco VPN Client -> Options->Desseleccionar a opção Stateful Firewall(Always on) .
Testei a minha VPN para o trabalho (VPN do windows xp) e funcionou !!!:D
O erro acontecia mesmo ser ter o VPN Client da cisco a correr..

Category: Uncategorized  | Tags: , ,  | Leave a Comment
it-improves ecológica
Friday, June 04th, 2010 | Author: admin

É com enorme prazer que anunciamos que o site e blog da it-improves se encontra alojado num datacenter ecológico, alimentado 100% a energia eólica.

affiliate_link

Anti Virus kaspersky
Monday, April 26th, 2010 | Author: admin

É com enorme prazer que anunciamos que a it-improves é revendedora da kaspersky, uma das mais reconhecidas empresa na área de anti-virus, firewall e uma das empresas com maior crescimento.

Entrem na loja online clicando na imagem abaixo.(estarão a comprar directamente do site da kaspersky)

Loja Kaspersky img

Sometimes in .net application we need to have a copy of a dll which is available in GAC. But when we view the GAC through C:\Windows\assembly folder or Run assembly it will show like this

Using this we cannot copy the dll. Only uninstall option is available.

To view the available dll using the naked eye follow the steps

Dot net have a dll file Shfusion.dll which is a Assembly Cache Viewer. It is located in the following path.

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\shfusion.dll

1.uninstall the dll using the following command in the run dialog box.

regsvr32 -u C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\shfusion.dll

1.Now type assembly in the Run dialog box.

2.Now you will see the folder view of the GAC. copy the dll you want.

Note:

To get back to the previous state of view register the Shfusion dll using the following command

regsvr32 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\shfusion.dll

Gerador Templates
Monday, April 12th, 2010 | Author: admin

Raramente falo aqui de produtos, mas acho que este vale a pena.
Quem já trabalhou com DotNetNuke(DNN), Joomla, Web sites em geral, sabe o trabalho que é criar um
template.
Agora isso é a parte mais fácil com o Artisteer.
O Artisteer é um gerador de templates com suporte para DNN, Joomla, WordPress, Blogger,Drupal, aplicação asp.net, etc.
É uma ferramenta espetactular!!
Teste e comprem que vale a pena, penso que até é barato para o que ela faz!
Link:
Artisteer - Web Design Generator

Category: Utilities  | Tags: , , , ,  | Leave a Comment
Web Hosting/Alojamento
Thursday, April 08th, 2010 | Author: admin

É com muito gosto que anunciamos mais um serviço prestado pela it-improves.

O nosso serviço de Alojamento e Registo de Domínios!
O alojamento é feito em Data Centes com a mais recente tecnologia, são ecológicos e seguros e melhor ainda o cliente é que escolhe entre 3 Data Centers!!(USA,Inglaterra, Suécia).

Veja os nossos planos e soluções aqui.
Se já sabe o que quer poderá preencher o formulário pelo link acima ou directamente
aqui

Was trying to access some ports on ours development website which someone mapped it to 6000.
Port 6000 is used for X11 protocol ( and 79 is used for finger).
Internet Explorer works fine but Google Chrome and Firefox don´t.
For Firefox exists one solution :)

Solution:Unblocking/allowing ports in Firefox

Launch Firefox

Go to the address bar and type about:config. Firefox will complain about some warranty just click ok or “I’ll be careful, i promise” button

You will see the list of configuration.
Anywhere inside the list of configurations, right click and say New –> String

In the string value, enter network.security.ports.banned.override then click OK

It will now ask you what port, say 6000 (in my case) or whatever port you need to have firefox access. Click OK.

And try again to the website you want to access. These settings should remain forever.

For Chrome, we’ve got some bad news, it is not possible to access certain ports.

See Chrome banned ports here: http://src.chromium.org/viewvc/chrome/trunk/src/net/base/net_util.cc
(look under the kRestrictedPorts directive.)

Original post from http://highsecurity.blogspot.com/2009/07/google-chrome-and-mozilla-firefox-non.html
(my post is a copy with a few changes only, all rigths for the author)

Forçar modo compatibilidade com o IE7 no IE8
Wednesday, October 21st, 2009 | Author: admin

Para forçar o IE8 a usar o modo de compatibilidade com IE7
tem que adicionar a seguinte tag:



<meta http-equiv="X-UA-Compatible" content="IE=7" / >

Mas é muito chato e complicado adicionar em todas as páginas esta tag mas isto pode ser definido no IIS e até no web.config.

No IIS6
Selecrione o website que pretende, botão direito do rato e propriedades e clique na tab HTTP Headers

Depois clique em Add



Depois só faz ok.
No IIS 7
Seleccione o site pretendido depois clique em HTTP Response Headers

Ao  clicar ira aparecer a seguinte imagem e é só preencher os valores

Também pode fazer isto adicionando as seguintes linhas no web.config ( que é o que faz o IIS 7)

Esta solução foi retirada de: http://weblogs.asp.net/joelvarty/archive/2009/03/23/force-ie7-compatibility-mode-in-ie8-with-iis-settings.aspx

WebServices Autenticação SOAP Header
Tuesday, October 13th, 2009 | Author: admin

Sempre que estamos a falar de webservices surge uma questão.

E a segurança?

Como vou autenticar os utilizadores?

Â
 

Uma das formas de fazer isso é com Soap Headers.

Â
 

Vamos por passos.

1º Crie a seguinte classe( com o nome que quiser )

 

using System;

using System.Data;

using System.Configuration;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using System.Web.Services.Protocols;

using System.Security.Cryptography;

 

///
<summary>

/// Summary description for AuthHeader

///
</summary>

public
class
AuthHeader:SoapHeader

{

   Â

        public
string Username;


public
string Password;

 


public
string decrypt(string data)

{

System.IO.MemoryStream msDecrypt = null;


CryptoStream csDecrypt = null;

System.IO.StreamReader srDecrypt = null;

 

System.Security.Cryptography.RijndaelManaged aesAlg = null;

 


string plaintext = null;


try

{


// Create a RijndaelManaged object


// with the specified key (IV parameter is obmitted because of ECB CipherMode).

aesAlg = new System.Security.Cryptography.RijndaelManaged();

aesAlg.Key = System.Text.Encoding.UTF8.GetBytes(“01030123012390129012901A”);

aesAlg.Mode = CipherMode.ECB;


// set PaddingMode.Zeros in order to use the same padding mode as in flash actionscript class

aesAlg.Padding = PaddingMode.Zeros;

 


// Create a decrytor to perform the stream transform.


ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV);

 


// Create the streams used for decryption.

msDecrypt = new System.IO.MemoryStream(Convert.FromBase64String(data));

csDecrypt = new
CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read);

srDecrypt = new System.IO.StreamReader(csDecrypt);

 


// Read the decrypted bytes from the decrypting stream


// and place them in a string.

plaintext = srDecrypt.ReadToEnd();


return plaintext.Replace(“\0″, “”);

}


finally

{


// Clean things up.


// Close the streams.


if (srDecrypt != null)

srDecrypt.Close();


if (csDecrypt != null)

csDecrypt.Close();


if (msDecrypt != null)

msDecrypt.Close();

 


// Clear the RijndaelManaged object.


if (aesAlg != null)

aesAlg.Clear();

}

 

}

 

 

 

 

 

}

 

2º No seu webservice adicione as seguintes linhas

public
class
SeuWebsercice : System.Web.Services.WebService

{


public
AuthHeader Authentication;

….

E em cada método
adicionar

[SoapHeader("Authentication", Required = true)]

Exemplo:

[SoapHeader("Authentication", Required = true)]

[WebMethod]


public
bool xptoMethod()

{

 

 

//validateUser é apenas exemplo.. podera ser um login
if(!System.Web.Security.Membership.ValidateUser(Authentication.decrypt(Authentication.Username),

Authentication.decrypt(Authentication.Password)))

 

{


return
false;

}

 

NOTA: neste exemplo é necessário efectuar a validação em cada metodo, no entando o melhor (dependendo do que se pretende) será guardar em sessão se o user ta autenticado

 

No lado do cliente:

Criar a classe de encriptação


private
static
string Encrypt(string input)

{

 

System.Security.Cryptography.RijndaelManaged aesAlg = null;

 


// Create a RijndaelManaged object


// with the specified key (IV parameter is obmitted because of ECB CipherMode).

aesAlg = new System.Security.Cryptography.RijndaelManaged();

 

//IMPORTANTE: esta chave ter que ser a mesma

aesAlg.Key = System.Text.Encoding.UTF8.GetBytes(“01030123012390129012901A”);

aesAlg.Mode = CipherMode.ECB;


// set PaddingMode.Zeros in order to use the same padding mode as in flash actionscript class

aesAlg.Padding = PaddingMode.Zeros;

 


// Create a decrytor to perform the stream transform.


ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV);


byte[] toEncrypt = System.Text.Encoding.UTF8.GetBytes(input);

System.IO.MemoryStream msEncrypt = new System.IO.MemoryStream();


CryptoStream csEncrypt = new
CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write);

 


// toEncrypt = textConverter.GetBytes(input);

 

csEncrypt.Write(toEncrypt, 0, toEncrypt.Length);

csEncrypt.FlushFinalBlock();

 


// return msEncrypt.ToArray();


return
Convert.ToBase64String(msEncrypt.ToArray());

}

 

Na classe onde ira ser chamado o webservice:

static WebSync.Sync websync = new WebSync.Sync();


static WebSync.AuthHeader aut = new WebSync.AuthHeader();

aut.Username = Encrypt(config.AppSettings.Settings["username"].Value);

aut.Password = Encrypt(config.AppSettings.Settings["password"].Value);

websync.AuthHeaderValue = aut;

 

O resto ( a chamada ao metodo) não é preciso alterar nada..
ex: webSync.xpto();

Imaginem que têm uma base dados ( o mais provável é não precisarem de imaginar porque têm mesmo lol )
em que várias tabelas possuem um campo chamado “data_criacao” e precisam de actualizar esse campo em todas as tabelas mas não sabem sequer que tabelas têm esse campo “data_criacao”.
Vamos por passos.
1º - Script para achar esse campo
    SELECT t.name AS table_name,
    SCHEMA_NAME(schema_idAS schema_name,
    c.name AS column_name
    FROM sys.tables AS t
    INNER JOIN sys.columns c ON t.OBJECT_ID c.OBJECT_ID
    WHERE c.name LIKE ‘%data_criacao%’
   ORDER BY schema_nametable_name;

Este script ira retornar o nome da tabela, o schema e nome da coluna (que terá de ser o nome que vocês pesquisaram :D )

2º Agora que já sabem onde estão ( mas não precisam de saber :) ) vamos a segunda parte.
O script para efectuar o update. 
Usaremos o script acima, com umas pequenas alterações, e vamos guardar o resultado numa variável e depois executamos essa variável
  begin transaction
declare @query varchar(max)
set @query=
SELECT @query=@query+‘update ‘ +t.name+’ set data_criacao=getdate() where data_criacao is null;’
–SCHEMA_NAME(schema_id) AS schema_name,
–c.name AS column_name
FROM sys.tables AS t
INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
WHERE c.name LIKE ‘%data_criacao%’
ORDER BY t.name;
exec(@query)
–commit

Não esquecer de verificar se esta tudo ok, e executar o commit que esta comentado…
Ter em atenção o tamanho máximo da varchar.. se tiverem muitas tabelas poderá não dar.. dúvido que tenham assim tantas..mas se tiverem insiram o resultado numa tabela temporária e para cada registo façam o exec :)


Qualquer dúvida, sugestão, correcção é só comentar :)
Abraços