VB.Net Tutorial on Webpage Screen capture 

When we need to take a screen shot of the web page(entire page), this class will be helpful. This class converts any web page written in any programming language if it renders in browser. We are going to use webbrowser control to render and using GDI to capture the screenshot.

The title given to this article, may mislead some how technically. But it is given for understanding purposes. Actually this class navigates to the given url using the .Net 2.0's Web Browser control. Once the navigation completed, the screen shot image can be taken with the help of GDI, and is instantaneous - don't worry about downloading images as the file is already on the offline portion of your computer, so whether or not you have unlimited hosting capabilities through broadband or a 56k connection doesn't matter.

Again t ...

Read more here:   Website Screen Capture 

14-Mar-2012

WPF Animation Using DoubleAnimation

Easiest way to animate is using the Double Animation provided by WPF. It is much easier to use the Double Animation as there are only few statements needed and they are quite straight forward to implement. For e.g. Specifying the following parameters will let you start understand the animation easily
• From
• To
• RepeatBehavior
• Duration
After this setup, just calling the BeginAnimation method alongwith which property needs to be animated (in our case it is the right property) will start sliding horizontally.

Animation Setup

For horizontal marquee, we need two controls. One is the outer panel and the sliding label.  For horizontal sliding or marquee we can either change the left property or right property using double animation object. For example we are going to try the right property.
If you want the sliding to be faster then reduce the duration. If you want the sliding t ...

30-Jun-2011

VB.Net Tutorial to find duplicate files

When you are receiving files from different server hosting but the content is same, there is a possibility of having a different filename for the same content. Hence finding a duplicate file just by file name may not be sufficient. To compare by file data, there are several ways.

Usage of Message Digest (MD5)

To find duplicate files even after renamed, the content/data has to be compared after the content of files fetched. Once the file content is in data format, the data can be encoded with MD5 hash algorithm. The string result after hash can be used for comparing. MD5 is a widely used cryptographic hash function with a 128-bit hash value, and is also commonly used to check the integrity of files

MD5 in .Net Framework

.NET Framework has very rich support for encryptWing and decrypting. Com ...

Read more here:   Find duplicate files using VB.Net 

10-Jun-2011

Tutorial on Sending Email

If you are still working in classic VB, sending email is not as easy as we do in asp.net. Especially for notifications emails are one of the best ways to communicate. Normally the SMTP server will be in separate email hosting server reachable from application server. In this scenario we need to configure CDO to use our SMTP server. Then only the mail relay will be successful.

The function we are discussing will support most of the email functionalities like CC, BCC and attachment.
 
The function will return the status about sent. Since this function is designed for applications, the related settings can be fetched from settings file rather than changing the code and re compiling to take changes.

Basically the following configurations are necessary before sending mail with CDO object
•  CDO.Message
• CDO.Co ...

Read more here:   VB Send Email 

10-Jun-2011

WPF Listbox Binding Images from DB

WPF ListBox control is quite different from windows win forms and it has lots of abilities to extend and design. With just ListBox we can design most of the equivalent controls available in ASP.Net data controls section. However the implementation of WPF ListBox is also quite different from win forms and ASP.Net controls. For e.g. binding an image is bit tricky than we do in ASP.Net and the linq and Ms SQL Sample DB northwind may demand additional knowledge on the respective technologies

Fetching Database values using Linq to SQL

As it has been already discussed in detail in the article WPF Datagrid and Linq to SQL, I am not going to detail again here. We can use the Linq to SQL to fetch the data and pass it to the WPF to bind the ListBox. The equivalent datatypes will be chose for the respective database fields. So the important mapping w ...

Read more here:   Wpf Listbox Image Binding From Db 

11-Feb-2011

VB.Net Tutorial - BackgroundWorker and Invoke

Those who have worked extensively on threading will feel that this article is simple. But for who are quite new to threading and learning the Asynchronous operations, this article can be useful to figure out how to introduce the Asynchronous to the existing methods to enhance the performance.

Why there is a need of Asynchronous or Background

Without the BackgroundWorker worker, you can still build a good application. However with the help of asynchronous operations, you can improve the processing time and hence the application will be highly responsive.

Run the source code sequential

I can prove that with the example I have given in this article. If you look at the source code event btnStart_Click, I have commented out the function BgWorkerFunction. To run without asynchronous you may comment out the BackgroundWorker1.RunWorkerAsync() function call and uncomment the BgWorkerFunction call. Now you can ...

09-Feb-2011

VB.Net Tutorial -Drawing libraries

‘System.Drawing’ can be one of the fun working libraries for working on interesting tasks like imaging. This is loaded with a lot of features that can make the drawing and imaging activities much easier.

Dealing with Bitmap

I usually prefer to work with bitmap when I am working on the imaging. The reason behind is, it has a lot of properties and methods to work with.  We can easily save, change the pixel, and retrieve the pixel.

Drawing Texts

Just like drawing the lines, pixels, circles on an image, it is very easy to write a text on the image using graphic object’s DrawString() method. This graphic object has to be based on the image where we are going to write to. So use the FromImage function of the Graphics to get the graphics object of the image.

Formatting with Graphics

Graphics object can be used to format the image, text. So use the properly suited overloaded method to handle the requ ...

Read more here:   Vb.Net Draw In Picturebox 

08-Feb-2011

VB.Net Tutorial -WebClient Object

The great helpful thing about developing with .NET is, a lot of objects introduced in .Net framework.One of them is this web client object. Earlier days we need to send the XmlHttp request or Web Request to send the request and receive the response. WebClient not only reduced the effort in downloading text, but also helpful in a lot of areas such as security and form submission etc…

DownloadString

As I said before the download string function makes the life easier. You can simply pass the URL to this function and it will return the response text. If the resource is secured you can send the Network Credentials to authenticate,
Dim webClient As New WebClient()
Dim Downloaded= webClient. DownloadString(URI)

HTML Head Title Access Denied

Now that is the error we are receiving, means that the access is denied while calling the resource. So we need to authenticate. Use the following to authenticate. The R ...

Read more here:   HTML Head Title Access Denied 

08-Feb-2011

VB.Net Tutorial - Close running processes

 .Net made it very easy for handling processes. It is much easier to close the applications using Process.Kill(). Processes can be iterated using the ‘for each’ loop. The process object taken from enumeration has enough methods and properties to deal with processes.

Get the list of processes

To get the list of instances running with the current applications name, we can use the Process.GetProcessesByName(“ProcessName”). This method returns collection of processes with the name “ProcessName”.  Thereafter accessing each process is easy with a ‘for each’ loop.

Kill other processes running under same name

I had a requirement to ensure that, current process is the only running process. The rest of the other instances of the processes have to be closed. Using the GetProcessesByName method we can get the list of current instances. While iterating thro the collection, we can identify the current process ...

Read more here:   VB.Net kill process by name 

08-Feb-2011

VB.Net Tutorial - Read Text File using VB6

In classic VB reading a file is not that easy as we do in vb.net. The first and easy way to access a text file is using the simple file open method available in classic Visual Basic. Using this method, we can allocate a unique file number for opening the file. further the same number has to be used for closing the file handle.

In addition to this, there are various modes a file can be opened. Some of them are Append, Binary, Input, Output, or Random. By default Random will be used.

Read text file in VB.Net

In VB.net we can read files very easily. The System.IO namespace contains really very useful set of functions which can reduce the effort and time in coding file related activities. One of the easiest is reading a text file into string System.IO.File.ReadAllText(FilePath).

Source code

Form1.Vb

Public C ...

Read more here:   Vb.Net Read Text File 

08-Feb-2011



Spam Bot Trap



   



Select Theme
White
Gray
Blue
Brown
GraySimple