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

  • Home
  • SEARCH
  • 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 1067179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:07:21+00:00 2026-05-16T20:07:21+00:00

Okay basically /// <summary> /// Sends the process. /// </summary> /// <param name=MD5>The M

  • 0

Okay basically

 /// <summary>
        /// Sends the process.
        /// </summary>
        /// <param name="MD5">The M d5.</param>
        /// <param name="procName">Name of the proc.</param>
        /// <param name="procLoc">The proc loc.</param>
        public void SendProcess(string MD5, string procName, string procLoc)
        {
            // Create a request using a URL that can receive a post. 
            WebRequest request = WebRequest.Create("http://localhost/EDAC//SubmitProc.php ");
            // Set the Method property of the request to POST.
            request.Method = "POST";
            // Create POST data and convert it to a byte array.
            string postData = "MD5=" + MD5 + "&procName=" + procName + "&procLoc=" + procLoc + "&userID=" + _userID;
            byte[] byteArray = Encoding.UTF8.GetBytes(postData);
            // Set the ContentType property of the WebRequest.
            request.ContentType = "application/x-www-form-urlencoded";
            // Set the ContentLength property of the WebRequest.
            request.ContentLength = byteArray.Length;
            // Get the request stream.
            Stream dataStream = request.GetRequestStream();
            // Write the data to the request stream.
            dataStream.Write(byteArray, 0, byteArray.Length);
            // Close the Stream object.
            dataStream.Close();
        }

This function is called in a loop

Process[] currentProcess = Process.GetProcesses();

                foreach (var process in currentProcess)
                {
                    var isContained = false;

                    foreach (var heldProcess in _processlist)
                    {
                        if (heldProcess.Id == process.Id)
                        {
                            isContained = true;
                        }
                    }
                    if (!(isContained))
                    {

                        try
                        {
                                _processLocs.Add(process.MainModule.FileName);
                                _processlist.Add(process);
                                _tw.WriteLine(process.ProcessName);
                                _tw.WriteLine(process.MainModule.FileName);
                                var md5 = GetMD5HashFromFile(process.MainModule.FileName);
                                _tw.WriteLine(md5);
                                SendProcess(md5, process.ProcessName, process.MainModule.FileName);
                        }
                        catch (Win32Exception ex)
                        {

                        }

                    }
                }

Basically this method is fine on my local host just not on web server, now this method is obviously not idle considering when program first loads you get about 30 connection requests and messages sent within half a second, it locks up basically, probably due to not getting a connection.

So whats the right way of doing this? Ive been looking for a way to get a loop going that waits until server is ready to take more data or is it possibly sending all of the objects and handling that into variables for insert php side

  • 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-05-16T20:07:22+00:00Added an answer on May 16, 2026 at 8:07 pm

    Okay basically

    public void SendProcess(string md5, string procName, string procLoc)
    {
        var values = new NameValueCollection
                     {
                         { "MD5",      md5      },
                         { "procName", procName },
                         { "procLoc",  procLoc  },
                         { "userID",   _userID  },
                     };
    
        using (var client = new WebClient())
        {
            client.UploadValues("http://localhost/EDAC/SubmitProc.php", values);
        }
    }
    

    You can call this function in a loop, and it should work.

    Note how the resources used (here: the WebClient) are disposed, so subsequent calls can reuse the same HTTP connection (connection pooling). Otherwise you quickly run into lots of open connections that cannot be reused.

    Now, repeatedly making lots of small HTTP requests is much less efficient than making a few larger requests. You should merge multiple requests into a single one and limit the number of requests per time unit to a reasonable level. You can use WebClient.UploadString or WebClient.UploadData to upload more complex data than simple key/value-pairs.

    That said, I’d never want to have a piece of software on my machine that sends the list of active processes to some server. I hope you have a big, fat warning in your application that warns users about your intrusion of their privacy.

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

Sidebar

Related Questions

Okay, so basically I have an enum: public enum A { A, B, C,
Okay basically here's where I'm at. I have a list of PropertyDescriptor objects. These
Okay, basically, I have a large list of phone numbers in a text file
Okay, so I am basically making a script to pass post data using cURL.
Okay guys, basically the problem I'm having is this. I've been assigned to write
Okay I wasn't really sure how to word this question, but basically what I
Okay basically, I'm designing and developing a fairly complicated website which revolves around the
Okay, basically I've developed a simple image upload system. The user selects a local
okay, so here is what im doing: class Connection { public int SERVERID; private
Okay so basically : i have this simple example: main.cpp using namespace VHGO::Resource; std::list<BaseTable*>

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.