|
IsComDLL - Check whether a DLL is an COM self-registering server
|
Total Hit (3045) |
«Code LangId=2»<System.Runtime.InteropServices.DllImport("kernel32")> Shared Function _
LoadLibrary(ByVal path As String) As Integer
End Function
<System.Runtime.InteropServices.DllImport("kernel32")> Shared Function _
GetProcAddress(ByVal hModule As Integer, ByVal procName As String)
....Read More |
Rating
|
|
|
Load a DataGrid Contol with XML Data using ADO.NET
|
Total Hit (1402) |
You will need to create a new Form, and then add three controls to it. A Button called btnImportXML, a DataGrid called DataGrid and a TextBox called txtPath.
Run the project and type the complete path to your XML document in the Textbox then click the Button. The DataGrid will be loaded with you
....Read More |
Rating
|
|
|
|
|
Hex2Dec - Convert from hexadecimal to decimal
|
Total Hit (8208) |
«Code LangId=2»' convert from hexadecimal to decimal
Function HexToDec(ByVal value As String) As Long
' we just need a call to the Convert.ToInt64 static method
Return Convert.ToInt64(value, 16)
End Function
«/Code»
|
Rating
|
|
|
IsDriveReady - Returns whether a drive is ready
|
Total Hit (3127) |
«Code LangId=2»
' Returns a boolean indicating whether a given drive is ready
' Example: check if the floppy disk drive is ready
' Debug.WriteLine(IsDriveReady("a"))
Function IsDriveReady(ByVal driveLetter As String) As Boolean
If driveLetter.Length = 1 Then driveLetter &= ":\"
Dim
....Read More |
Rating
|
|
|
|
|
|
Close the DataReader before changing database
|
Total Hit (2676) |
The ChangeDatabase method of the ADO.NET Connection object requires an open connection to execute correctly. Even if the connection is open, you can still have an InvalidOperationException when invoking this method; this happens when you are reading data from the connection by means of a DataReader
....Read More |
Rating
|
|
|
Visually browsing hierarchical files
|
Total Hit (2662) |
VS.NET has a nice feature that allows you to visually navigate through the content of hierarchical files, and quickly jump to a particular section. Hierarchical files are all those files written in XML-like syntax, such as .HTML, .ASPX and .Config files. To use this feature, click the View | Other W
....Read More |
Rating
|
|
|
|
Process individual pixels of a bitmap
|
Total Hit (3896) |
While you can access individual pixels of a bitmap by means of the GetPixel and SetPixel methods of the Bitmap object, in practice you seldom want to use these methods, as they are simply too slow for most cpu-intensive operations. Fortunately there is a faster way, which consists of moving all the
....Read More |
Rating
|
|
|
|
How to perform recursive search for files or folders in VB.net
|
Total Hit (4379) |
This is a very common requirement to find all or specific files in a specified foder and all subfolders.
You can use GetDirectories and GetFiles of System.IO.DirectoryInfo for this purpose. Check the following example.
«code LangId=2»Sub FindFilesDemo()
Dim msg As String
Dim ar As Ne
....Read More |
Rating
|
|
|
InsertImageIntoRtb - Inserting an image into a RichTextBox
|
Total Hit (4842) |
«Code LangId=2»
' Insert an image into a RichTextBox, in the current position
'
' This version takes in input the target RichTextBox and the path of the image
' to insert
' Example: InsertImageIntoRtb(RichTextBox1, "C:\test.jpg")
Sub InsertImageIntoRtb(ByVal rtb As RichTextBox, ByVal imgPat
....Read More |
Rating
|
|
|
Create a Touch utility
|
Total Hit (3187) |
The SetCreationTime, SetLastWriteTime, and SetLastAccessTime methods of the System.IO.Directory class let you modify the date attributes of a file or directory:
«Code LangId=2»
' Change the access date- and time of all files in C:\DOCS.
For Each fname In Directory.GetFiles("c:\docs")
File.
....Read More |
Rating
|
|
|
ADO.NET: Retrieve Data from SQL Server
|
Total Hit (580) |
This sample illustrates how to read data from SQL Server using the SqlDataReader class. This class provides a way of reading a forward-only stream of data records from a data source. If you want to work with databases that have OLE DB interfaces or versions of SQL Server prior to SQL Server 7.0, see
....Read More |
Rating
|
|
|
What Is Authorization Manager
|
Total Hit (1126) |
Role-based security has been evolving on the Windows platform since the first release of Windows NT. Using roles, the operating system can make determinations, such as whether a process is privileged, by checking the security context for a group called BUILTIN\Administrators. The operating system ma
....Read More |
Rating
|
|
|
Simple Object Access Protocol: A Step-By-Step Approach by Syd Egan
|
Total Hit (2575) |
In the article, we will create a simple SOAP service, and a client to access that service. The service will be in the form of an Active Server Page, which I have called soap.asp - it will need to live in the root directory of your Personal Web Service (by default c:\inetpub\wwwroot\) Our service wil
....Read More |
Rating
|
|
|
How Do I...Use resources?
|
Total Hit (692) |
This example demonstrates how to use resource files, dynamically loading a particular resource based on a selected culture. Resources allow you to develop robust, culture-aware programs without having to recompile your application because the resources have changed. The code required to access eleme
....Read More |
Rating
|
|
|
Building Reusable Components in .NET
|
Total Hit (2199) |
One of the main advantages of building components is to promote reusability. For example, if you build a object that represents an invoice, there could be many other projects in your company that can reuse the same object. This concept of re-using components in various projects promotes what is call
....Read More |
Rating
|
|
|
|
|
Using Classes and Structures in Visual Basic .NET
|
Total Hit (1109) |
This article is intended to help developers choose between a class and a structure when writing an application. You can review the basic points of comparison between the two types in the "Structures and Classes" topic of the Visual Studio .NET product documentation. To find this topic, start Visual
....Read More |
Rating
|
|
|
|
XPath Tutorial
|
Total Hit (530) |
XPath is a Query language for XML. You can use XPath to retrive data from XML document. XPath gives you faster performance and flexibility.
This tutorial will explain you all basic concepts of XPath. It covers folloing topics.
«LI»XPath Tutorial
«LI»XPath HOME
«LI»XPath Intro
«LI»XPath Synt
....Read More |
Rating
|
|
|
Stripping HTML Tags using Regular Expressions
|
Total Hit (1867) |
Have you ever wanted to strip all of the HTML tags from a string? There are many reasons you may want to do this. For example, if you provide a feature on your site where a user can have the contents of a Web page emailed to them, you may wish to strip all of the HTML tags from the particular articl
....Read More |
Rating
|
|
|
How Do I...Read XML from a file?
|
Total Hit (945) |
This sample illustrates how to read XML from a file using the XmlTextReader class. This class provides direct parsing and tokenizing of XML, and implements the W3C Extensible Markup Language (XML) 1.0 and the Namespaces in XML specifications.
|
Rating
|
|
|
Subclassing In .NET
|
Total Hit (1960) |
In VB 5 and 6, subclassing was something of a pain. To do it at all you needed a raft of cunning hacks and had to keep a very careful track on which object was subclassing what. All of that pain is removed in .NET with the System.Windows.Forms.NativeWindow class, which makes it almost trivial to pro
....Read More |
Rating
|
|