Enterprise Library: Criar ligação à base de dados de forma dinâmica
Já alguma vez precisaram, usando o Enterprise Library, de estabelecer uma ligação com um número de base de dados variável e em que a base de dados a ligar...
Converting Hexadecimal string to byte[]
string hexString = txtHex.Text; int discarded; txtByteCount.Text = ((int)HexEncoding.GetByteCount(hexString)).ToString(); txtLength.Text = hexString.Length.ToString(); byte byteArray = HexEncoding.GetBytes(hexString, out discarded);
Dealing with Memory Pressure problems in MOSS and WSS
I just a found another great post about memory management and performance issues on the SharePoint platform. This article defines the concept of "Memory Pressure" and discusses in great...
using System.Web.Mail with authentication
MailMessage msg = new MailMessage();
msg.From = ConfigurationSettings.AppSettings.ToString();msg.Subject = subject;msg.To = messageTo;msg.Fields = Settings.SmtpServer;msg.Fields = Settings.SmtpServerPort.ToString(CultureInfo.InvariantCulture);msg.Fields = 2;msg.Fields = 1;msg.Fields = Settings.SmtpSendUserName;msg.Fields = Settings.SmtpSendPassword;SmtpMail.Send( msg );
Como Serializar um Objecto para XML e Deserializar um XML para Objecto
Serializar um Objecto para String (XML)
StringWriter sw = new StringWriter();
XmlSerializer serializer = new XmlSerializer(typeof(OBJECT));
serializer.Serialize(sw, getAcessoryEquipmentsRequest.SearchCriteria);
strXML = sw.ToString();
Deserializar uma String (XML) para Objecto
StringReader sr = new StringReader(strXML);
XmlSerializer serializer =...
Create ThumbNail from image byte[]
private byte GenerateThumbNail(byte foto){
System.IO.MemoryStream memStream = new System.IO.MemoryStream(foto);
int thumbWidth = 88; int thumbHeight = 100; if (QueryStringHelper.ItemType == "detail"){ thumbWidth = 250;thumbHeight = 250;}
System.Drawing.Image myImage = System.Drawing.Image.FromStream(memStream);
HtmlImage...
Different web.configs
In the project that I'm currently working I had a problem because my connection strings are different from the other developers: I want to work locally in my SQL...
Aprovisionamento de sites no IIS6 usando uma aplicação ASP.NET
O exemplo apresentado de seguida permite efectuar a criação de um site no IIS6 a partir de uma template. Esta solução torna-se particularmente útil para cenários em que seja necessário...
TechEd EMEA 2008
Next week i'll be @ TechEd EMEA 2008 Developers in Barcelona with my colleague João Martins aka "Jota".I hope it will be a very interesting week, Pedro Rosa from Microsoft Portugal...
Integration Tests in .NET WebApi
In software development, testing is an essential aspect that ensures the stability and reliability of applications. Three primary types of tests are commonly used: unit tests, integration tests, and end-to-end tests. In this blog post, we will discuss these testing types in the context of a .NET WebAPI project and provide an example implementation of integration testing using an in-memory database.