|
Determine whether a string is uppercase
|
Total Hit (3048) |
Here's a quick-and-dirty method to determine whether a string contains only uppercase characters
«Code LangId=2»
' the string to test is in the SOURCE variable
If System.Text.RegularExpressions.Regex.IsMatch(source, "^[A-Z]+$") Then
Console.WriteLine("Uppercase string")
End If
«/Code»
....Read More |
Rating
|
|
|
Language features - String
|
Total Hit (4541) |
String is a powerful datatype which you use everyday. VB.net gives you great functionality with String class. In this article we will see some common functions of string class and will also learn about StringBuilder class for very fast string operations.
<big>Facts about String class</big>
<b>
....Read More |
Rating
|
|
|
|
|
Filter file names on their names or attributes
|
Total Hit (2761) |
The GetFiles and GetDirectories methods of the System.IO.Directory class can take an argument containing wildcards, to filter the result:
«Code LangId=2»
' Display all the *.txt files in C:\DOCS.
Dim fname As String
For Each fname In Directory.GetFiles("c:\docs", "*.txt")
Console.WriteLin
....Read More |
Rating
|
|
|
|
|
A Complete guide to .net Framework
|
Total Hit (1654) |
The Microsoft .NET Framework is a platform for building, deploying, and running XML Web services and applications. It provides a highly productive, standards-based, multiple-language environment for integrating existing investments with next-generation applications and services, as well as the agili
....Read More |
Rating
|
|
|
Adding an image as an embedded resource, and loading it from code
|
Total Hit (2606) |
To add an image as an embedded resource in a Windows Forms application, add the image file to the project with Project | Add Existing Item. Then select the file in the Solution Explorer, go to the Properties Window, and set its Build Action property to Embedded Resource. At this point the file will
....Read More |
Rating
|
|
|
|
Case insensitive replace in .net
|
Total Hit (11987) |
Sounds easy right.... but sometimes it can take your entire day how to do that using String Replace method. By default .Net string operations are case sensetive. In order to do case insensitive you need to use Strings.Replace method this is another replace method provided for VB programmers.
«co
....Read More |
Rating
|
|
|
CompareFiles - Comparing two binary/text files
|
Total Hit (2725) |
«Code LangId=2»' Returns a boolean indicating whether two files are equal
' Example: Debug.WriteLine(CompareFiles("D:\File1.mdb", "D:\File2.mdb"))
Function CompareFiles(ByVal path1 As String, ByVal path2 As String) As Boolean
Dim file1 As New System.IO.FileInfo(path1)
Dim file2 As New
....Read More |
Rating
|
|
|
|
Iterating over the characters in a string
|
Total Hit (2848) |
Visual Basic .NET strings support the For Each statement, so you can iterate over each individual character as follows:
«Code LangId=2»
Dim s As String = "ABCDE"
Dim c As Char
For Each c In s
Console.Write(c & ".") ' => A.B.C.D.E.
Next
«/Code»
However, you should bear in mind th
....Read More |
Rating
|
|
|
ExplodeString - Add a filling char between a string's chars
|
Total Hit (2486) |
«Code LangId=2»
' "Explode" a string by inserting a given filling character
' between consecutive characters in the original string
'
' The source string cannot contain Chr$(0) characters
Function ExplodeString(ByVal Source As String, Optional ByVal fillChar As Char = _
" "c) As String
....Read More |
Rating
|
|
|
|
Running an Insert SQL Query with ADO.NET and VB.NET
|
Total Hit (1600) |
If you have SQL server setup on your machine and the Northwind database then this example should work for you. You may have to change the password for the sa account as it's blank in the example.
|
Rating
|
|
|
|
|
|
Dashed lines with custom caps
|
Total Hit (4278) |
You can set properties of the Pen object to create custom lines. For example, you can use the DashStyle enumerated property to draw dashed lines using a predefined pattern, and you can even create custom dash patterns by assigning an array of Single values to the DashPattern property. The StartCap a
....Read More |
Rating
|
|
|
|
Multithreaded Programming with Visual Basic .NET
|
Total Hit (1162) |
The .NET Framework provides new classes that make it easy to create multithreaded applications. This article discusses how you can use multithreaded programming techniques with Visual Basic® .NET to develop more efficient and responsive applications.
....Read More |
Rating
|
|
|
Flat Style Combo Boxes
|
Total Hit (2093) |
This article provides a class which you can attach to any .NET ComboBox control to allow it to render with a VS.NET or Office XP flat style by subclassing the messages associated with the control (VB.NET and C# code provided).
|
Rating
|
|
|
Efficiently Searching a Sorted Array
|
Total Hit (1516) |
Pop quiz, hotshot: you have an array of strings consisting of the various IP addresses of the visitors of the last 24 hours to your Web site. You want to determine if your site has been visited by the IP address 231.34.124.3. How can you quickly figure out if the string "231.34.124.3" is in the arra
....Read More |
Rating
|
|
|
Receiving and Using Clipboard Change Notifications
|
Total Hit (2238) |
Clipboard support in the .NET Framework is fairly comprehensive, however, support for notification of clipboard changes is not provided. Knowing when the clipboard changes makes building an application with a toolbar containing a Paste button simpler; it also enables you to store a history of clipbo
....Read More |
Rating
|
|
|
Role-Based Authorization With Forms Authentication
|
Total Hit (1529) |
In Web applications, typically there exist certain parts of the site that only certain individuals, or groups of individuals, can access. For example, imagine an intranet Web site used to administer the content on a company's public Internet Web site, where the public Web site lists products sold by
....Read More |
Rating
|
|
|
|
Remoting Overview
|
Total Hit (1221) |
The common language runtime Remoting infrastructure provides a rich set of classes that allow developers to ignore most of the complexities of deploying and managing remote objects. Even though you are dealing with applications running against different run-time environments, calling methods on remo
....Read More |
Rating
|
|
|
Object Syntax Introduction
|
Total Hit (1777) |
From the publisher: "In this book, we cover VB.NET virtually from start to finish: we begin by looking at the .NET Framework, and end by looking at best practices for deploying .NET applications. In between, we look at everything from database access to integration with other technologies such as XM
....Read More |
Rating
|
|