Import namespace
using System.IO;
Code
using System.IO; DriveInfo drive = new DriveInfo(@"C:\"); long space = drive.AvailableFreeSpace;
The programmer's notebook is a reference for programmers. Here you can find code snippet's for VB.Net, C# .Net, WPF and many more...
using System.IO;
using System.IO; DriveInfo drive = new DriveInfo(@"C:\"); long space = drive.AvailableFreeSpace;
Imports System.Data
Public Class UsingMsAccess
Private Sub AddNewRecord()
'Replace path to "accessdatabasepath" with the actual path to the ms access database
'example C:\testApp\data\mydata.mdb
Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=accessdatabasepath"
Dim dbConnection As DbConnection = New OleDbConnection(connectionString )
Dim queryStr As String = "SELECT [Employees].* FROM [Employees]"
Dim dbCommand As DbCommand = New OleDbCommand
dbConnection.Open()
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
Dim dataAdapter As DbDataAdapter = New OleDbDataAdapter
Dim commandBuilder as DbCommandBuilder= New OleDbCommandBuilder(dataAdapter)
dataAdapter.SelectCommand = dbCommand
Dim MydataSet As DataSet = New DataSet
dataAdapter.Fill(MydataSet,"Employees") 'where employees is the name of the datatable
dim NewRow as datarow = MydataSet.tables("Employees").Newrow
NewRow("Name") = "sammy" 'Replace ("Name") with your own table field name
NewRow("Age") = 27
MydataSet.tables("Employees").Rows.Add(NewRow)
dataAdapter.Update(MydataSet,"Employees")
MydataSet.tables("Employees").AcceptChanges()
End Sub
Dim acroRdrPath As String, pdfFilePath As String Private Sub Command1_Click() acroRdrPath = "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe" pdfFilePath = "c:\my documents\260_2C05.pdf" Shell acroRdrPath & " " & pdfFilePath , vbNormalFocus End Sub
function targetBlank (url) {
blankWin = window.open(url,'_blank','menubar=yes,toolbar=yes,location=yes,directories=yes,fullscreen=no,titlebar=yes,hotkeys=yes,status=yes,scrollbars=yes,resizable=yes');
}
The test domain in a new window