C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2720
Number of posts: 5746

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Scanning Program (into Database) help Posted by crajkzie on 24 May 2012 at 8:26 AM
Hey i working with a Database in Access and i have started with a program that scans file ends (.rar, .jpg, .mp4, .dem) and im new to this connection strings through Databases i would really appreciate some help with the code for the connections it looks like this right now:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Data.OleDb;

namespace Scanner
{
class Program
{
static void Main(string[] args)
{

string[] filePaths = Directory.GetFiles("C:\\Windows\\system32");
foreach (string file in filePaths)
{
string filetype = file.Split('.')[file.Split('.').Length - 1];
switch (filetype)
{
case "jpg":
// Code to add into the Database, into the Table for Grenade Pictures
break;
case "mp4":
// Code to add into the Database, into the Table for Videos
break;
case "rar":
// Code to add into the Database, into the Table for Configs
break;
case "dem":
// Code to add into the Database, into the Table for Demos
break;
case "pdf":
// Code to add into the Database, into the Table for Tactics
break;
default:
break;
}
}
}
}
}



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.