Progged programming site

Programming source code, articles, tutorials, links and chat

Archive for the 'Source Code' Category

read contents of a directory

reads in the contents of a directory and display as links
<?function directory($result) {
$handle=opendir("".""); while ($file = readdir($handle)) { if ($file == ""."" || $file == "".."") { } else { print ""<a href=$file>$file</a><br>""; }
} closedir($handle); return $result; } echo directory($result); ?>

Bookmark It

Hide Sites

[ Back to top ]

Read an ini file

The contents of the ini file are listed below
[settings1] text1 = "hello" text2 = "world"
[settings2] number1 = 4 number2 = 8
//print out all of the contents of the test.ini file
<?php $ini_array = parse_ini_file("test.ini");print_r($ini_array);?>

Bookmark It

Hide Sites

[ Back to top ]

Mp3 search

searches a location for mp3 files and then displays them in a word document

Set objWord = CreateObject("Word.Application") Set objDoc = objWord.Documents.Add() Set objSelection = objWord.Selection objWord.Visible = True
objSelection.TypeText "MP3 lister" objSelection.TypeParagraph() objSelection.TypeText "" & Now objSelection.TypeParagraph() objSelection.TypeParagraph()
objWord.FileSearch.FileName = "*.mp3" objWord.FileSearch.LookIn = "D:\" objWord.FileSearch.SearchSubfolders = True objWord.FileSearch.Execute
For Each objFile in objWord.FileSearch.FoundFiles objSelection.TypeText objFile objSelection.TypeParagraph() Next

Bookmark It

Hide [...]

[ Back to top ]

Get disk info using VBScript and the FSO

Get disk info using VBScript and the FSO
Set objFso = CreateObject("Scripting.FileSystemObject")
Set drive = objFso.GetDrive("C")
With drive
Wscript.Echo "Available Space:", .AvailableSpace & vbCrLF & _ "Drive Letter:", .DriveLetter & vbCrLF & _ "Drive Type:", .DriveType & vbCrLF & _ "File System:", .FileSystem & vbCrLF & _ "Free Space:", .FreeSpace & vbCrLF & _ "Is Ready:", .IsReady & vbCrLF [...]

[ Back to top ]

Sponsors