Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to hide build in library functions, identifier or such stuffs of code when we are comparing two code files and we want to ignore these things which are common ??????

is there any build in function to use in .NET IDE any idea about it...............

like here

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;


class file1
  {
     public void add()
  {
    int a;
    int b;

    int c = a + b;

    console.WriteLine("print the sum" + c);
   }
  }


and here second

C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;

class file2
  {
     public void multiply()
  {
    int a;
    int b;

    int c = a * b;

    console.WriteLine("print the sum" + c);
   }
  }


now if i want to compare these two input coding files so i want to ignores its build_in functions or keywords ect so would we do this .......


i just gave the example of these files i am working on comparing files for their similarities to check they are copied or not and now i faced this problem that i have to ignore such all build in functions otherwise it would give wrong answer for their similarities...
Posted
Updated 12-Dec-11 10:52am
v3
Comments
Monjurul Habib 12-Dec-11 16:23pm    
clarification required ...
Addy Tas 12-Dec-11 17:11pm    
It would help if you'd specify what your expected output is, appart from differences in white spaces i don't see what you could skip and still have a sensible output. You can still discuss comments but i'm a bit inclined to say that if someone bothered to add a bit of comment, it might just be important enough to look at.
More info == better answer.
[no name] 12-Dec-11 17:42pm    
we don't get it

1 solution

I'm afraid, there is no such built-in function to achieve what you are expecting. You should write your own technique to compare the files ignoring what ever you don't want to compare.

If you would like a compare without ignoring anything you can use the File Compare[^]

Or, in case if you would like manual compare to check the structure etc to find out if the code is copied or not, you can use Beyond Compare Tool[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900