This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Text; | |
namespace Example { | |
class Program { | |
static void Main(string[] args){ | |
string[] words = {"mr.", "bryan", "miller"}; | |
for(int i=0; i < words.Length; i++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* shows how to count the number of top-level | |
subdirectories within a given directory | |
online at: | |
https://gist.github.com/kyrathasoft/d130f93dce7fb45341d18e6872b192cd | |
To compile, use build.bat. Or, at the command line: | |
csc /out:copydir.exe *.cs | |
Here is the structure of this example program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static bool CopyTo(string targetDirectory, string destinationDirectory) | |
{ | |
bool blnSuccess = false; | |
try{ | |
if(Directory.Exists(targetDirectory)){ | |
foreach (string dirPath in Directory.GetDirectories(targetDirectory, "*", | |
SearchOption.AllDirectories)){ | |
Directory.CreateDirectory(dirPath.Replace(targetDirectory, destinationDirectory)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* shows how to count the number of top-level | |
subdirectories within a given directory | |
To compile: csc /out:count.exe *.cs | |
Here is the structure of this example program | |
and associated directories, on disk: | |
examples/CountTopLevelDirectories | |
- countTopDirs.cs (file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace ExampleOfOrderingByDate { | |
class OrderingByDate{ | |
public static List<DateTime> myList; | |
public static void Main(string[] args){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Collections.Generic; | |
using com.wms.dirs; | |
using com.wms.files; | |
/* | |
You'll first need to compile dirs.dll from com_wms_dirs.cs. That source code is found | |
in c:\csdev\library\dirs_dll\, or at these URLs: | |
+ https://gist.github.com/kyrathasoft/aca4a458ce58edb05f4476a8186cae33 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Collections.Generic; | |
namespace com.wms.dirs{ | |
public class ClassDirs{ | |
public static int CountDirectoriesRecursively(string targetDirectory) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.IO.Compression; | |
using System.Collections.Generic; | |
using System.Text; | |
namespace com.wms.zip{ | |
public class ClassZip{ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using com.wms.crypt; | |
namespace ConsoleApplication { | |
//uses crypt.dll produced from this src code: https://gist.github.com/kyrathasoft/f436e4bfaed8bf2f43f7d72916a4e670 | |
class Program{ | |
static void Main(string[] args){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Security.Cryptography; | |
using System.Drawing; | |
namespace com.wms.crypt{ | |
/* | |
+ https://gist.github.com/kyrathasoft/f436e4bfaed8bf2f43f7d72916a4e670 | |
+ https://pastebin.com/RNinZTiz |