Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8999445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:10:53+00:00 2026-06-16T00:10:53+00:00

i am build application that open Wireshark services (Wireshark has several services) in order

  • 0

i am build application that open Wireshark services (Wireshark has several services) in order to to different things on Wireshark files like Edit, change format, statistics etc…
each option usually use different service so i want to build my classes with inheritance
i was wonder if what i want to do is appropriate way or proper way:

main class WiresharkServices with the following members and method:
this is the class that all the other classes should inherite from

public class WiresharkProcesses
{
    protected string _filePath; //the file path who send to Wiresahrk process
    protected string _capinfos;
    protected string _dumpcap;
    protected string _editcap;
    protected string _mergecap;
    protected string _rawshark;
    protected string _text2pcap;
    protected string _tshark;
    protected string _wireshark;

    public void initializeServices()
    {
        if (Directory.Exists(@"C:\Program Files (x86)\Wireshark"))
        {
            _capinfos = @"C:\Program Files (x86)\Wireshark\_capinfos.exe";
            _dumpcap = @"C:\Program Files (x86)\Wireshark\_dumpcap.exe";
            _editcap = @"C:\Program Files (x86)\Wireshark\editcap.exe";
            _mergecap = @"C:\Program Files (x86)\Wireshark\_mergecap.exe";
            _rawshark = @"C:\Program Files (x86)\Wireshark\_rawshark.exe";
            _text2pcap = @"C:\Program Files (x86)\Wireshark\_text2pcap.exe";
            _tshark = @"C:\Program Files (x86)\Wireshark\_tshark.exe";
            _wireshark = @"C:\Program Files (x86)\Wireshark\_wireshark.exe";
        }
        else if (Directory.Exists(@"C:\Program Files\Wireshark"))
        {
            _capinfos = @"C:\Program File)\Wireshark\_capinfos.exe";
            _dumpcap = @"C:\Program Files\Wireshark\_dumpcap.exe";
            _editcap = @"C:\Program Files\Wireshark\editcap.exe";
            _mergecap = @"C:\Program Files\Wireshark\_mergecap.exe";
            _rawshark = @"C:\Program Files\Wireshark\_rawshark.exe";
            _text2pcap = @"C:\Program Files\Wireshark\_text2pcap.exe";
            _tshark = @"C:\Program Files\Wireshark\_tshark.exe";
            _wireshark = @"C:\Program Files\Wireshark\_wireshark.exe";
        }
    }
}

when the application running i am check of course if Wireshark installed on the machine and if not throw exception and in Wireshark exist:

WiresharkServices wservices = new WiresharkServices();
wservices .initializeServices();

and in each class it’s own methods.

child class example who receive file path to convert it to other Wireshark format:

public class Editcap : WiresharkProcesses
{
    private string _newFileName;

public void startProcess(string filePath)
{
    FileInfo file = new FileInfo(filePath);
    _newFileName = file.FullName.Replace(file.Extension, "_new") + ".pcap";
    ProcessStartInfo editcapProcess = new ProcessStartInfo(string.Format("\"{0}\"", _editcap))
    {
        Arguments = string.Format("{2}{0}{2} -F libpcap {2}{1}{2}", file.FullName, _newFileName, "\""),
        WindowStyle = ProcessWindowStyle.Hidden,
        RedirectStandardOutput = true,
        RedirectStandardError = true,
        CreateNoWindow = true,
        UseShellExecute = false,
        ErrorDialog = false
    };

    using (Process editcap = Process.Start(editcapProcess))
    {
        editcap.WaitForExit();
    }
}

public string getNewFileName()
{
    return _newFileName;
}

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:10:54+00:00Added an answer on June 16, 2026 at 12:10 am
    public void initializeServices()
    {
        string programFilesDirectory = "";
    
        if (Directory.Exists(@"C:\Program Files (x86)\Wireshark"))
            programFilesDirectory = @"C:\Program Files (x86)\";
    
        else if (Directory.Exists(@"C:\Program Files\Wireshark"))
            programFilesDirectory = @"C:\Program Files\";
    
        _capinfos = programFilesDirectory + @"_capinfos.exe";
        _dumpcap = programFilesDirectory + @"_dumpcap.exe";
        _editcap = programFilesDirectory + @"editcap.exe";
        _mergecap = programFilesDirectory + @"_mergecap.exe";
        _rawshark = programFilesDirectory + @"_rawshark.exe";
        _text2pcap = programFilesDirectory + @"_text2pcap.exe";
        _tshark = programFilesDirectory + @"_tshark.exe";
        _wireshark = programFilesDirectory + @"_wireshark.exe";
    

    Change it for start…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build a application that has different kinds of users, I'm using
I'm trying to build application that could help me dial a contact just like
I would like to build an application that connects to multiple databases. A customer
I am attempting to build an application that imports GeoRSS files into Google Maps,
I want to build an application that will load the web like the web
I've build a small java application that uses selenium 2 to open a web
I want to build flash application that can detect the user eyes color and
I need to build an application that accepts user input data (such as name,
I want to build an application that exports user data of another app. The
I'm looking to build an application that will rely on adding menu extensions to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.