|
how about using this for disabling the taskman..... impossible is nothin
System.IO.File.Open("taskmgr.exe", FileMode.Open, FileAccess.ReadWrite, FileShare.None);
|
|
|
|
|
How does opening it disable it ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
modify the fileshare to grant total acess,,,
|
|
|
|
|
It seems to me that you're kind of dense. As has been said, the ONLY way to totally block access, is with group policies. I can think of lots of other things you could try, but none of them are fool proof. So long as the student is not locked down on the PC, they will find a way around what you're trying to do. Such as, writing a program that finds the process and kills it, or using the command line to kill it ( as someone else said ).
If this is homework, then stop going in circles, your teacher should know that what you're trying to do won't work. If it's a paid job, then tell the people you are robbing that they are just stupid enough to deserve to be working with you.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
i am dosing this work as a graduation project.... and i do have knowkedge that task manaver can be accessed sinply by renaming the System.IO.File.Open("renamed_taskmagr.exe".... but i should try some thing to help me in not ending my program by the task man at the start up by the student who should login and provide his information...
|
|
|
|
|
max.4u wrote: but i should try some thing to help me in not ending my program by the task man at the start up by the student who should login and provide his information...
If you want to do *something*, write a service that checks if the application has closed, and re-opens it. That might make your teacher happy, but if he's not a moron, he'll know that whatever you do, was a waste of time, it's not the place to try to enforce what you want. Overall, you are wasting a lot of time on something really stupid. If your teacher did not ask you to do this, then stop wasting your time, as you've been told over and over, you can't do it this way, not in a foolproof way.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
If you have ReadWrite access to taskmgr.exe, you're logged in as administrator. Administrators can do what they want with the system. You're just trying to make 'harmful' UI unavailable, but there's always a way around it.
I've seen kiosk mode web browsers that tried to take the same approach. Usually all it takes to get around them is to browse to a PDF document, click Adobe's "Save" button, and in the Save As dialog, browse to "C:\windows\system32\cmd.exe" and right-click>Run.
You'll never find ALL 'harmful' UI elements!
What you really should do is disable harmful ACTIONS, not UI. Use group policy and disable task manager, the command line, etc.
And don't log in as administrator: Administrators can do everything !
|
|
|
|
|
thans but u are telling to block harmful actions not the programs... but i think it is easy to block the taskman rather than allowing it to open and then block it from ending my applications process..... if such code exists or if i could hide my applications process from the taskman like virus do then also it would be more complex code generation... so the KISS way.... block the taskmgr.exe....
|
|
|
|
|
The KISS way is to open the group policy options and click on 'disable task manager'.
|
|
|
|
|
nice what does the KISS way tel about doing the same gpedit.msc way from c# code.. hope its simple....!
|
|
|
|
|
All right. If you're so bloody clever figure out the code for yourself. You've been told by several experts that the way to do this is to use policies to cope with it, and yet you persist in arguing. Fine - write the code, post it up and then see how long it is before somebody finds a way to work round it (btw - somebody could rename tastmanager.exe and launch that so any approach you had to block it by name would fail).
|
|
|
|
|
hey man you are on fire... why dont you just help by telling how to call the policy manager from the code and disable the taskmanager.....
|
|
|
|
|
max.4u wrote: why dont you just help by telling how to call the policy manager from the code and disable the taskmanager.....
I can see that you were told 11 minutes before you posted this message. See this post[^]
|
|
|
|
|
hello.. am extreamly sorry for whats happening here... i was only making new ways of doing the thing.... sorry if i have hurted any one.... once more...
|
|
|
|
|
you are right Max.....
Sometimes taskmanager must be disabled for security purpose...
|
|
|
|
|
|
Imagine that one of the processes on the computer goes banana's. I know that it's unusual, since Windows is such a stable platform, but for arguments sake, let's imagine that there is a virus-checker on your system and that it's gone into an infinite loop, eating away 100% cpu time.
..and the virus-scanner starts when Windows start, rendering your machine useless.
That's why we have a task-manager
I are troll
|
|
|
|
|
Hi,
I want to bind only one column, from the collection of columns of the DataTable table, to a DataGidView.I tried with this code
for (int c = 0; c <= i; c++)
{
dataGridView1.DataSource = dt1.Rows[i,1].ToString();
dataGridView1.Refresh();
}
but Nothing is displayed in dataGridView1. Please reply me if anyone know the solution.
|
|
|
|
|
You don't loop through the rows. Instead you define a datasource for the DataGridView, create a column in it and define the column from the datatable to show. For example something like this:
DataGridViewTextBoxColumn column = new DataGridViewTextBoxColumn();
column.DataPropertyName = "ColumnInDataTable";
column.HeaderText = "Header";
column.Name = "somename";
this.dataGridView1.Columns.Add(column);
this.dataGridView1.DataSource = dt1;
Of course you are aware that you can do this also in the designer.
|
|
|
|
|
Hi.......
U have lots of options to do this....
First One:
By Using BindingSource:::>> dataGridView1:>properties:>Choose Datasource:>{If u have already one then select it otherwise select Add Project Datasource}
If u cann't follow this Just message me!!!!!!
Second One:
fill dataset according to ur needs....
DataView dv = new DataView(dt.Tables["Specify table name here"]);
dataGridView1.DataSource = dv;
dataGridView1.Refresh();
{Remember Donn't Add Columns to DataGridView }
try this...... and reply me....
|
|
|
|
|
Hi Everyone,
I would just like to ask a question in relation to calling a web service.
I know how to call a web method when the return value is a string or an integer, however I am having difficulty in returning a dataset method that is in a class.
The following error gets returned
Error 1 Cannot implicitly convert type 'System.Data.DataSet' to 'ConnectToDB'
and i have tried several times to rectify this by changing the return value to string yet it relays a similar message to the above. . I guess my main query is , how do i create the web method so that it can return a dataset from the database?
Would someone be able to assist? Many Thanks. The code is below.
<br />
<br />
using System;<br />
using System.Data;<br />
using System.Configuration;<br />
using System.Linq;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.HtmlControls;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Xml.Linq;<br />
using System.Data.SqlClient;<br />
public class ConnectToDB<br />
{<br />
public ConnectToDB()<br />
{<br />
}<br />
<br />
public static DataSet FilterCustomersByCountry(string country)<br />
{<br />
<br />
string query = "SELECT DISTINCT COUNTRY FROM CUSTOMERS WHERE COUNTRY LIKE" + "'"+country+"'";<br />
using (SqlConnection conn = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\MyCompany.MDF;Integrated Security=True;User Instance=True"))<br />
{<br />
DataSet ds = new DataSet();<br />
<br />
SqlDataAdapter adapter = new SqlDataAdapter(query, conn);<br />
adapter.Fill(ds, "Customers");<br />
<br />
return ds;<br />
<br />
}<br />
}<br />
}<br />
<br />
<br />
using System;<br />
using System.Collections;<br />
using System.Linq;<br />
using System.Web;<br />
using System.Web.Services;<br />
using System.Web.Services.Protocols;<br />
using System.Xml.Linq;<br />
using System.Data.SqlClient;<br />
using System.Data.Sql;<br />
<br />
[WebService(Namespace = "http://AJAXAutocomplete.org/",Name="AutocompleteVersion1")]<br />
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />
public class AutoComplete : System.Web.Services.WebService {<br />
<br />
public AutoComplete () {<br />
<br />
}<br />
<br />
[WebMethod] <br />
public ConnectToDB SuggestionsFromDB(string country) <br />
{<br />
return ConnectToDB.FilterCustomersByCountry(country);<br />
}<br />
<br />
}<br />
<br />
<br />
|
|
|
|
|
If you want to return a dataset from the web method, use something like:
[WebMethod]
public System.Data.Dataset SuggestionsFromDB(string country)
{
return ConnectToDB.FilterCustomersByCountry(country);
}
The ConnectToDB is your class for getting the data.
Also note that never use concatenation in the sql statement in a situation like this. You're fully open to SQL injections. So your query should be:
string query = "SELECT DISTINCT COUNTRY FROM CUSTOMERS WHERE COUNTRY LIKE @Country";
and then you define a SqlParameter[^] to give the query a value.
|
|
|
|
|
Awesome answer Mika, Thanks very much for your help and the heads up about the SQL injection.
Best Regards
|
|
|
|
|
You're welcome
|
|
|
|
|
Hi,
I have a situation like this:
I have a web-page where several "textboxes" and have an Excel file.
I have no direct access to web-page, that is, I can only open it in web-browser - https://
I need to copy data from Excell cell into textbox, and push an ENTER button. Of course, the web-page is open at the moment.
I know how to copy data from Excel into html, but have no experience how to copy into textbox in an open IE. and how to push link/button in IE.
could anybody help ???
Respectfully,
Exceter.
|
|
|
|