Home / Software / Computer programming / Programming in C#
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2  All - (Bottom) Print
Author Topic: Programming in C#  (Read 1532 times)
Boasta
Topic Starter
Starter



Posts: 4


« on: August 19, 2009, 09:56:05 AM »

Can someone pliz who know how to create an antivirus using C# help me because i want to create an antivirus ;D
IP logged
Aegis
Expert



Thanked: 67
Posts: 2,698

Experience: Experienced
OS: Windows XP



Brian's Mess Of A Web Page 1
« Reply #1 on: August 19, 2009, 11:09:45 AM »

Describe your current level of knowlege of C# programming, please.
IP logged



"For you, a thousand times over." - "The Kite Runner"
BC_Programmer
Mastermind


Thanked: 697
Posts: 15,881

Computer: Specs
Experience: Beginner
OS: Windows 7


Pinkie Pie is best pony

BC-Programming.com 1 1
« Reply #2 on: August 19, 2009, 11:11:23 AM »

you can't create a AV program in C#... at least, not an on-demand scanner.
IP logged

My Blog

BASeBlock 2.3.0 (NOW WITH MACGUFFINS!)
Aegis
Expert



Thanked: 67
Posts: 2,698

Experience: Experienced
OS: Windows XP



Brian's Mess Of A Web Page 1
« Reply #3 on: August 19, 2009, 11:13:10 AM »

Well, I pretty much demonstrated MY level of C# knowledge, didn't I?   ::)
IP logged



"For you, a thousand times over." - "The Kite Runner"
BC_Programmer
Mastermind


Thanked: 697
Posts: 15,881

Computer: Specs
Experience: Beginner
OS: Windows 7


Pinkie Pie is best pony

BC-Programming.com 1 1
« Reply #4 on: August 19, 2009, 12:18:36 PM »

well, you probably could, but parts of it will surely need to be lower level.

now, my parlance was wrong. I use the term "on-demand" not to mean started by the user but rather "on-demand" when programs are executed.

a program that fits the common, if not altogether misleading, "on-demand" scanner, such as malwarebytes, is possible via C#.

(heck, MBAM itself is written in Visual Basic 6...)
IP logged

My Blog

BASeBlock 2.3.0 (NOW WITH MACGUFFINS!)
Boasta
Topic Starter
Starter



Posts: 4


« Reply #5 on: August 21, 2009, 09:31:31 AM »

Can someone pliz who know how to create an antivirus using C# help me because i want to create an antivirus ;D
I am still learning
IP logged
Aegis
Expert



Thanked: 67
Posts: 2,698

Experience: Experienced
OS: Windows XP



Brian's Mess Of A Web Page 1
« Reply #6 on: August 21, 2009, 09:43:20 AM »

Then my suggestion is to start out with more simple programs so you may continue to learn the basics, and build upon what you learn.
IP logged



"For you, a thousand times over." - "The Kite Runner"
BC_Programmer
Mastermind


Thanked: 697
Posts: 15,881

Computer: Specs
Experience: Beginner
OS: Windows 7


Pinkie Pie is best pony

BC-Programming.com 1 1
« Reply #7 on: August 21, 2009, 09:44:08 AM »

I agree. A AV combines a multitude of skills- File access, GUI programming, tabulating and processing data, etc etc.
IP logged

My Blog

BASeBlock 2.3.0 (NOW WITH MACGUFFINS!)
smeezekitty
Newcomer



Thanked: 44
Posts: 0


« Reply #8 on: August 21, 2009, 12:05:23 PM »

i think teh orig poster only wants to make a AV that you manually start the scan
and the program terminates
the hard part is, is recursive directory search
i also think this is homework
IP logged

Acer extensa 463oz
2 gb ram
160gb hdd
2ghz processor
and desk fan sitting next to it for cooling :)
BC_Programmer
Mastermind


Thanked: 697
Posts: 15,881

Computer: Specs
Experience: Beginner
OS: Windows 7


Pinkie Pie is best pony

BC-Programming.com 1 1
« Reply #9 on: August 21, 2009, 12:36:10 PM »

the hard part is, is recursive directory search

err, no... the hard part is scanning each file... where will he get the database? how will he generate it?

Recursive directory search is fairly easy.

C#:

Code: [Select]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            DirectoryInfo currdir = new DirectoryInfo(System.IO.Directory.GetCurrentDirectory());
           
            viewdir(currdir);




        }
        static void viewdir(DirectoryInfo argument)
        {
            foreach (FileInfo fileuse in argument.GetFiles())
            {
                Console.WriteLine(fileuse.FullName);

            }
            foreach (DirectoryInfo dir in argument.GetDirectories())
            {
                Console.WriteLine(dir.FullName);
                viewdir(dir);


            }
           

        }
    }
}


IP logged

My Blog

BASeBlock 2.3.0 (NOW WITH MACGUFFINS!)
smeezekitty
Newcomer



Thanked: 44
Posts: 0


« Reply #10 on: August 21, 2009, 12:39:26 PM »

err, no... the hard part is scanning each file... where will he get the database? how will he generate it?

Recursive directory search is fairly easy.

C#:

Code: [Select]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            DirectoryInfo currdir = new DirectoryInfo(System.IO.Directory.GetCurrentDirectory());
           
            viewdir(currdir);




        }
        static void viewdir(DirectoryInfo argument)
        {
            foreach (FileInfo fileuse in argument.GetFiles())
            {
                Console.WriteLine(fileuse.FullName);

            }
            foreach (DirectoryInfo dir in argument.GetDirectories())
            {
                Console.WriteLine(dir.FullName);
                viewdir(dir);


            }
           

        }
    }
}



but does it go back to the root directory when done scanning subs?
IP logged

Acer extensa 463oz
2 gb ram
160gb hdd
2ghz processor
and desk fan sitting next to it for cooling :)
BC_Programmer
Mastermind


Thanked: 697
Posts: 15,881

Computer: Specs
Experience: Beginner
OS: Windows 7


Pinkie Pie is best pony

BC-Programming.com 1 1
« Reply #11 on: August 21, 2009, 12:46:12 PM »

that doesn't even make sense.

It's called a "call stack"... each call to "viewdir" calls "viewdir" for each subdirectory, after listing all the files present in the directory.

This is called "recursion".

It's also possible via a stack/array, which can be stored on the heap rather then the stack frame, but this only applies to unsophisticated operating systems that put seemingly arbitrary limits on the use of Memory past 640K.
IP logged

My Blog

BASeBlock 2.3.0 (NOW WITH MACGUFFINS!)
smeezekitty
Newcomer



Thanked: 44
Posts: 0


« Reply #12 on: August 21, 2009, 12:57:43 PM »

i mean does it return back to root directory to continue scanning
after its scaned all sub directorys?
i could never get that righht
IP logged

Acer extensa 463oz
2 gb ram
160gb hdd
2ghz processor
and desk fan sitting next to it for cooling :)
BC_Programmer
Mastermind


Thanked: 697
Posts: 15,881

Computer: Specs
Experience: Beginner
OS: Windows 7


Pinkie Pie is best pony

BC-Programming.com 1 1
« Reply #13 on: August 21, 2009, 01:07:32 PM »

I can't think of a reason why it wouldn't.
IP logged

My Blog

BASeBlock 2.3.0 (NOW WITH MACGUFFINS!)
Boasta
Topic Starter
Starter



Posts: 4


« Reply #14 on: August 22, 2009, 04:07:04 AM »

I am still learning programming and i would be happy if someone could show me some samples or either some documents about the creation of an antivirus
IP logged
Pages: [1] 2  All - (Top) Print 
Home / Software / Computer programming / Programming in C# « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.113 seconds with 20 queries.