Monday, March 06, 2006

CODE ROOM - Reality Show

Episode 1
In this new reality show, three MSDN event attendees are taken to an inner-city warehouse, equipped with a partially-charged laptop, and tasked with designing and developing an e-commerce Web site.

Episode 2
In this second episode of The Code Room, watch the sparks fly, the egos flair, and the light bulbs go off as a solution is produced under pressure using the latest mobile bits from Microsoft including Bluetooth, Visual Studio 2005, the .NET Compact Framework 2.0, and SQL Server CE on the Smartphone.

Episode 3
In this episode of The Code Room watch the White Hats and Black Hats battle for the security of Las Vegas. Jessi Knapp and Microsoft Security Guru Joe Stagner narrate as the Hackers try to gain control of The Plaza's online money management system and our Security Team tries to stay one step ahead.

Thursday, December 08, 2005

Edit Visual Studio Project List

Sometimes I get annoyed by some junky projects I created showing up on the "Start Page" of Visual Studio, even if I deleted them from the hard-disk.

To simply remove them from the list, edit the registries at:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\\ProjectMRUList

Friday, November 04, 2005

ASP.NET 2.0 deployment tag

there's a new setting to put in web.config


<
deployment retail="true" />


if this is set to 'true' , debug errors won't show on website.

Thursday, November 03, 2005

How to send authenticated email (ASP.NET 2.0)

OK, they changed some classes in .NET Framework 2.0

Here's how to send an email in aspn 2.0 :

(Imports System.Net)





Dim client As New SmtpClient("smtp.server.com") 'your smtp server
client.UseDefaultCredentials = False
client.Credentials = New Net.NetworkCredential("username", "password") 'Your username and password to login
client.DeliveryMethod = SmtpDeliveryMethod.Network

Dim Mail As New MailMessage("from@email.com", "to@email.com", "This is my subject", "This is my pretty, yet boring and useless message")
Mail.IsBodyHtml = True
'Mail.BodyEncoding = System.Text.Encoding.UTF8


Try
client.Send(Mail)
Catch ex As Exception
Response.Write(ex.Message) 'Write error message
Exit Sub
End Try

'successfull

Friday, September 09, 2005

Set Text for a Textbox with TextMode = Password

Ok so If you have a textbox with the property TextMode set to "Password" if you try

textbox.Text = "whatever", you'll end up with nothing

The right way to accomplish this is :

textbox.Attributes.Add("value", "whatever")

Saturday, August 27, 2005

Free e-book : VB.NET Fundamentals

Here's a good and free e-book from innerworkings:

-> VB .NET Fundamentals (Paul Sheriff & Ken Getz)

They also offer 3 articles :
-> ASP.NET Validation Controls
-> ASP.NET State Management
-> XML Processing

Thursday, August 25, 2005

Here's a list of free Visual Studio 2005 Free Videos, from the guy who owns www.learnvisualstudio.net . I had an account on his site, two years ago and it helped me a lot in learning .NET, but now he offers some free videos ... So make sure you grab them fast !

Move form by clicking anywhere on its surface

The code is quite simple and suggestive:


Dim a, b As Integer
Dim newPoint As New System.Drawing.Point()

Private Sub ab_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
a = Me.MousePosition.X - Me.Location.X
b = Me.MousePosition.Y - Me.Location.Y
End Sub

Private Sub ab_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
If e.Button = MouseButtons.Left Then
newPoint = Me.MousePosition
newPoint.X = newPoint.X - a
newPoint.Y = newPoint.Y - b
Me.Location = newPoint
End If
End Sub

If u have a Label on the form and u want to be able to move the form also by clicking the label, just add handles for the label also .
Ex : Private Sub ab_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown, Label.MouseDown

and :

Private Sub ab_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove, Label.MouseMove