Filthy Rich Clients refers to ultra-graphically rich applications that ooze cool. They suck the user in from the outset and hang on to them with a death grip of excitement. Filthy Rich Clients: Developing Animated and Graphical Effects for Desktop Java Applications shows you how to build better, more effective, cooler desktop applications.
read more | digg story
Saturday, November 17, 2007
Monday, October 22, 2007
Download Book on Microsoft Expression Web
Get a jump start on using this brand-new Web creation tool from Microsoft. Built from the ground up using current Web standards, Expression Web make it easy to create pages that look good in all browsers. Mirroring the program’s focus on standards, the book shows you how to use Cascading Style Sheets to build consistent, easy to navigate designs.
read more | digg story
read more | digg story
Friday, August 17, 2007
A potentially dangerous Request.Form value was detected from the client
It means that you can't post values containing HTML ( or script ) tags to the server. In other words - if you have a textbox and the visitor enters something like
< script> alert('a') < "/ script> and then presses Submit button this error will occur since the posted value(s) contains HTML tags.,it's for security reasons.to prevent this you can add a tag validateRequest="false" into the Page-directive on top of the page you want users to be able to input HTML and script tag or you can write in the web.config file it will affect all pages on your site.You can read more at ASP.Net site.
< script> alert('a') < "/ script> and then presses Submit button this error will occur since the posted value(s) contains HTML tags.,it's for security reasons.to prevent this you can add a tag validateRequest="false" into the Page-directive on top of the page you want users to be able to input HTML and script tag or you can write in the web.config file
Saturday, May 12, 2007
Encrypting Text using DESCryptoServiceProvider
While creating a User Account form on your website, you probably need to store users information like username, email address and password in your database.If you are storing user passwords in unencrypted form then if someone compromises your database they have access to the passwords for every user.
I am writing some code snippet that will do the encrypting for you, using DESCryptoServiceProvider, you can find this object under System.Security.Cryptography.
'Encrypt the text
Public Shared Function EncryptText(ByVal strText As String) As String
Return Encrypt(strText, "&%#@?,:*")
End Function
'Decrypt the text
Public Shared Function DecryptText(ByVal strText As String) As String
Return Decrypt(strText, "&%#@?,:*")
End Function
'The function used to encrypt the text
Private Shared Function Encrypt(ByVal strText As String, ByVal strEncrKey As String) As String
Dim byKey() As Byte = {}
Dim IV() As Byte = {&H12, &H34, &H56, &H78, &H90, &HAB, &HCD, &HEF}
Try
byKey = System.Text.Encoding.UTF8.GetBytes(Left(strEncrKey, 8))
Dim des As New DESCryptoServiceProvider
Dim inputByteArray() As Byte = Encoding.UTF8.GetBytes(strText)
Dim ms As New MemoryStream
Dim cs As New CryptoStream(ms, des.CreateEncryptor(byKey, IV),CryptoStreamMode.Write)
cs.Write(inputByteArray, 0, inputByteArray.Length)
cs.FlushFinalBlock()
Return Convert.ToBase64String(ms.ToArray())
Catch ex As Exception
Return ex.Message
End Try
End Function
'The function used to decrypt the text
Private Shared Function Decrypt(ByVal strText As String, ByVal sDecrKey As String) As String
Dim byKey() As Byte = {}
Dim IV() As Byte = {&H12, &H34, &H56, &H78, &H90, &HAB, &HCD, &HEF}
Dim inputByteArray(strText.Length) As Byte
Try
byKey = System.Text.Encoding.UTF8.GetBytes(Left(sDecrKey, 8))
Dim des As New DESCryptoServiceProvider
inputByteArray = Convert.FromBase64String(strText)
Dim ms As New MemoryStream
Dim cs As New CryptoStream(ms, des.CreateDecryptor(byKey, IV), CryptoStreamMode.Write)
cs.Write(inputByteArray, 0, inputByteArray.Length)
cs.FlushFinalBlock()
Dim encoding As System.Text.Encoding = System.Text.Encoding.UTF8
Return encoding.GetString(ms.ToArray())
Catch ex As Exception
Return ex.Message
End Try
End Function
I am writing some code snippet that will do the encrypting for you, using DESCryptoServiceProvider, you can find this object under System.Security.Cryptography.
'Encrypt the text
Public Shared Function EncryptText(ByVal strText As String) As String
Return Encrypt(strText, "&%#@?,:*")
End Function
'Decrypt the text
Public Shared Function DecryptText(ByVal strText As String) As String
Return Decrypt(strText, "&%#@?,:*")
End Function
'The function used to encrypt the text
Private Shared Function Encrypt(ByVal strText As String, ByVal strEncrKey As String) As String
Dim byKey() As Byte = {}
Dim IV() As Byte = {&H12, &H34, &H56, &H78, &H90, &HAB, &HCD, &HEF}
Try
byKey = System.Text.Encoding.UTF8.GetBytes(Left(strEncrKey, 8))
Dim des As New DESCryptoServiceProvider
Dim inputByteArray() As Byte = Encoding.UTF8.GetBytes(strText)
Dim ms As New MemoryStream
Dim cs As New CryptoStream(ms, des.CreateEncryptor(byKey, IV),CryptoStreamMode.Write)
cs.Write(inputByteArray, 0, inputByteArray.Length)
cs.FlushFinalBlock()
Return Convert.ToBase64String(ms.ToArray())
Catch ex As Exception
Return ex.Message
End Try
End Function
'The function used to decrypt the text
Private Shared Function Decrypt(ByVal strText As String, ByVal sDecrKey As String) As String
Dim byKey() As Byte = {}
Dim IV() As Byte = {&H12, &H34, &H56, &H78, &H90, &HAB, &HCD, &HEF}
Dim inputByteArray(strText.Length) As Byte
Try
byKey = System.Text.Encoding.UTF8.GetBytes(Left(sDecrKey, 8))
Dim des As New DESCryptoServiceProvider
inputByteArray = Convert.FromBase64String(strText)
Dim ms As New MemoryStream
Dim cs As New CryptoStream(ms, des.CreateDecryptor(byKey, IV), CryptoStreamMode.Write)
cs.Write(inputByteArray, 0, inputByteArray.Length)
cs.FlushFinalBlock()
Dim encoding As System.Text.Encoding = System.Text.Encoding.UTF8
Return encoding.GetString(ms.ToArray())
Catch ex As Exception
Return ex.Message
End Try
End Function
Wednesday, May 09, 2007
Using XML file as a Database
To make my Application Database independent, I have Explored using XML file as an storage instead of using database.
Have a look at My Article , I have posted it at CodeProject.
http://www.codeproject.com/useritems/WritingDataInXMLFile.asp
Have a look at My Article , I have posted it at CodeProject.
http://www.codeproject.com/useritems/WritingDataInXMLFile.asp
Monday, May 07, 2007
Uploading Image and Creating Water Mark
Uploading Image and Creating Water Mark
Dim MyFile As HtmlControls.HtmlInputFile = CType(Page.FindControl("File1"), HtmlControls.HtmlInputFile)
Dim fileName As String = MyFile.PostedFile.FileName.Substring
(MyFile.PostedFile.FileName.LastIndexOf("\") + 1)
Dim image As System.Drawing.Image = System.Drawing.Image.FromStream(MyFile.PostedFile.InputStream)
MyFile.PostedFile.SaveAs(filePath)
Dim bitmap_Large As Bitmap = New Bitmap(image)
Dim bitmap_Thumb As Bitmap = New Bitmap(image, 118, 118)
Dim GraphicsWriter As Graphics = Graphics.FromImage(bitmap_Large)
Dim stringFormat As New StringFormat
stringFormat.FormatFlags = StringFormatFlags.DirectionVertical GraphicsWriter.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias GraphicsWriter.FillRectangle(Brushes.Green, 0, 0, 25, bitmap_Large.Height) GraphicsWriter.DrawString("Copyright MyDomain.com " & DateTime.Now.Year, New Font("Verdana", 12, FontStyle.Bold), Brushes.White, New PointF(0, (bitmap_Large.Height / 2) - 122), stringFormat)
bitmap_Large.Save(MapPath("..\upload\Large\" & FileName & ".jpg"), image.RawFormat)
bitmap_Thumb.Save(MapPath("..\upload\thumb\" & FileName & ".jpg"), image.RawFormat)
Dim MyFile As HtmlControls.HtmlInputFile = CType(Page.FindControl("File1"), HtmlControls.HtmlInputFile)
Dim fileName As String = MyFile.PostedFile.FileName.Substring
(MyFile.PostedFile.FileName.LastIndexOf("\") + 1)
Dim image As System.Drawing.Image = System.Drawing.Image.FromStream(MyFile.PostedFile.InputStream)
MyFile.PostedFile.SaveAs(filePath)
Dim bitmap_Large As Bitmap = New Bitmap(image)
Dim bitmap_Thumb As Bitmap = New Bitmap(image, 118, 118)
Dim GraphicsWriter As Graphics = Graphics.FromImage(bitmap_Large)
Dim stringFormat As New StringFormat
stringFormat.FormatFlags = StringFormatFlags.DirectionVertical GraphicsWriter.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias GraphicsWriter.FillRectangle(Brushes.Green, 0, 0, 25, bitmap_Large.Height) GraphicsWriter.DrawString("Copyright MyDomain.com " & DateTime.Now.Year, New Font("Verdana", 12, FontStyle.Bold), Brushes.White, New PointF(0, (bitmap_Large.Height / 2) - 122), stringFormat)
bitmap_Large.Save(MapPath("..\upload\Large\" & FileName & ".jpg"), image.RawFormat)
bitmap_Thumb.Save(MapPath("..\upload\thumb\" & FileName & ".jpg"), image.RawFormat)
Saturday, May 05, 2007
Take the power of Google Maps with you on your mobile phone.
Take the power of Google Maps with you on your mobile phone.
Real-time traffic — See where the congestion is, and estimate delays in over 30 major US metropolitan areas.
Detailed directions — Whether you plan to walk or drive, your route is displayed on the map itself, together with step-by-step directions.
Integrated search results — Local business locations and contact information appear all in one place, integrated on your map.
Easily movable maps — Interactive maps let you zoom in or out, and move in all directions so you can orient yourself visually.
Satellite imagery — Get a bird's eye view of your desired location. (It's like you're there, we swear.)
Looking for other ways to access Google local listings from your mobile device? Try text messaging Google or using your mobile web browser to get local listings.
Visit www.google.com/gmm on your mobile web browser
Real-time traffic — See where the congestion is, and estimate delays in over 30 major US metropolitan areas.
Detailed directions — Whether you plan to walk or drive, your route is displayed on the map itself, together with step-by-step directions.
Integrated search results — Local business locations and contact information appear all in one place, integrated on your map.
Easily movable maps — Interactive maps let you zoom in or out, and move in all directions so you can orient yourself visually.
Satellite imagery — Get a bird's eye view of your desired location. (It's like you're there, we swear.)
Looking for other ways to access Google local listings from your mobile device? Try text messaging Google or using your mobile web browser to get local listings.
Visit www.google.com/gmm on your mobile web browser
Subscribe to:
Posts (Atom)