473,408 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

C# Application blocking

Hello i am learning to program using C# i want to write my first ever program i guess im jumping in at the deep end but i like it like this

i am trying to block an application from running its a cheat program for legend of mir called DBT3 i have the code to kill it but people can just restart the program

Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using System.Diagnostics;
  9.  
  10. namespace WindowsApplication1
  11. {
  12.     public partial class Form1 : Form
  13.     {
  14.         public Form1()
  15.         {
  16.             InitializeComponent();
  17.         }
  18.  
  19.         private void button1_Click(object sender, EventArgs e)
  20.         {
  21.             Process[] ps = Process.GetProcessesByName("DBT3");
  22.  
  23.             foreach (Process pr in ps)
  24.             {
  25.                 pr.Kill();
  26.                 pr.Close();
  27.             } 
  28.         }
  29.     }
  30. }
  31.  
i dont know how to block it from coming up again or can i place a timer on it and then re exacute the Kill function?

many thanks if u can solve my problem
Aug 31 '08 #1
8 4158
joedeene
583 512MB
Hello i am learning to program using C# i want to write my first ever program i guess im jumping in at the deep end but i like it like this

i am trying to block an application from running its a cheat program for legend of mir called DBT3 i have the code to kill it but people can just restart the program

Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using System.Diagnostics;
  9.  
  10. namespace WindowsApplication1
  11. {
  12.     public partial class Form1 : Form
  13.     {
  14.         public Form1()
  15.         {
  16.             InitializeComponent();
  17.         }
  18.  
  19.         private void button1_Click(object sender, EventArgs e)
  20.         {
  21.             Process[] ps = Process.GetProcessesByName("DBT3");
  22.  
  23.             foreach (Process pr in ps)
  24.             {
  25.                 pr.Kill();
  26.                 pr.Close();
  27.             } 
  28.         }
  29.     }
  30. }
  31.  
i dont know how to block it from coming up again or can i place a timer on it and then re exacute the Kill function?

many thanks if u can solve my problem

well ya, a simple timer would work, like set it to a really less interval rate, like maybe 1000, or 2000. like copy the button1 click event into a the timer_tick sub, after you drag a timer onto the form in designer mode, which will, by default, be named 'timer1'.


so the code should just be like this *not tested*
Expand|Select|Wrap|Line Numbers
  1.   private void timer1_Tick(object sender, EventArgs e)
  2.         {
  3.             Process[] ps = Process.GetProcessesByName("DBT3");
  4.  
  5.             foreach (Process pr in ps)
  6.             {
  7.                 pr.Kill();
  8.                 pr.Close();
  9.             } 
  10.         }
(now you have to double click the timer icon in designer mode for it to set its handle to timer1_tick, hope i helped.
Sep 1 '08 #2
OMG m8 i love you it worked

woooooooo

your a great help thanks alot

that little code snippet kills the prosess with out having to press a button

thanks m8

kudos to you
Sep 1 '08 #3
ok i have came to another problem

there is a server launcher to launch the game how can i hook onto that and block connection and write a text on the screen saying blocked or something like that
Sep 1 '08 #4
for some reson i cant edit or merge my posts sorry about that

here are all the problems i have now

1) need to add a Message onto another program if this application is killed
2) need to and an If statment i.e if application killed send xxx data to a DB to block account
3) Block connection to my server if my anti cheat application is not running

or i can make it simple and when this launcher is loaded it loads my anti cheat progam but would still need to know how to add number 2 in
many thanks
Sep 1 '08 #5
Curtis Rutland
3,256 Expert 2GB
You have a limited time to edit posts, and only moderators can merge.

As to your questions, it is a bit out of our scope...most of those questions depend on how the clients connect, what they connect to, and whether this is a third party app or one you wrote.

I'm not sure how much help we can be. This forum is geared toward specific .NET questions, not large solutions.

If this game isn't something that you wrote, I don't think you will be able to pass messages to it unless it has an API. If it does, check it's documentation.
Sep 1 '08 #6
You have a limited time to edit posts, and only moderators can merge.

As to your questions, it is a bit out of our scope...most of those questions depend on how the clients connect, what they connect to, and whether this is a third party app or one you wrote.

I'm not sure how much help we can be. This forum is geared toward specific .NET questions, not large solutions.

If this game isn't something that you wrote, I don't think you will be able to pass messages to it unless it has an API. If it does, check it's documentation.
ahhh ok well thanks for the reply and sorry for tripple posting :D
Sep 1 '08 #7
joedeene
583 512MB
OMG m8 i love you it worked

woooooooo

your a great help thanks alot

that little code snippet kills the prosess with out having to press a button

thanks m8

kudos to you

your welcome, bud.

joedeene
Sep 1 '08 #8
thought i would add this after a long search through google

c# does not offer DLL hooking to manipulate another program you need to use a unmanaged Programming language like Delphi
Sep 1 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Jonathan Fine | last post by:
Hello I have written a program that interacts with a command line program. Roughly speaking, it mimics human interaction. (With more speed and accuracy, less intelligence.) It works fine...
3
by: David Sworder | last post by:
This message was already cross-posted to C# and ADO.NET, but I forgot to post to this "general" group... sorry about that. It just occured to me after my first post that the "general" group readers...
4
by: Richard | last post by:
hi, I am using SQL SERVER 2000. Problem that i am facing is when ever I check locks in Enterprise Manager I find following blocking - : 1) sp_cursoropen;1 2) sp_cursorclose;1 3)...
2
by: Shobhit | last post by:
Hey Guys im new to this forum...i m not very much perfect in C.....but i can stand over....my prob is that...i m looking out for code in C if possible Linux Based or logic so that i can code for...
2
by: Rene | last post by:
Hi, In my VB6 application I'm using a class/object that is using full-async ADO. I can start multiple queries, the class stores the ADODB.Recordset object in an array and waits for the...
5
by: Simon Knox | last post by:
Hi I have a web app that has a legitimate use for pop up windows. My web app is an insurance quoting app. I use the window.open method to display another aspx page so that the user can check...
3
by: Bob | last post by:
Hi, I have an app that has a 3rd party phone answering control (4 of ) (interfacing with dialogic 4 line card) attached to the main form. each control raises an event when its Dialogic line...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.