Set Permissions For Killing Process?

Mar 25, 2011

I am calling example.exe from asp.net web-page. Example.exe contains Process.Kill(), but I am not able to kill that process whenever Ill run example.exe from asp.net web page. I think i need to set some permissions for killing processes. What permissions must a user have to be able to succesffuly execute a rocess.Kill? Note : it is working when I double clicking on (example.exe), means its killing some processes

View 2 Replies


Similar Messages:

Web.config - RunAllManagedModulesForAllRequests = "true" Killing Windows Authentication In IIS7?

Jan 8, 2010

We have windows authentication set up on our staging server for our clients to help prevent google from indexing our staging URLs. We recently found out that one of our sites is seemingly ignoring our IIS settings (anonymous authentication is disabled, windows authentication is enabled). We ended up figuring out that removing the setting runAllManagedModulesForAllRequests="true" on the modules node (which is required for our URL rewriting on the site) fixes the issue and the windows login/password box appears as expected when we browse to the site. If we keep the setting there, the site allows any anonymous user to browse the website.How can we keep anonymous authentication off while keeping runAllManagedModulesForAllRequests set to true?

EDIT: We realized that we have other sites where this setting is on and windows authentication is working just fine. This only appears to happen in our ASPDotNetStorefront websites. I'm now wondering where I should check to see what is causing this issue - my guess is some sort of custom authentication module, but I don't have enough knowledge to figure out where to start debugging this.

View 1 Replies

Security :: Killing The Session / Login When Attempting To Login In Different Computer?

Feb 22, 2010

Let's say I have 2 computers and has internet connections. let's say in computer 1 I visit the my page and i log-in as User1 and I go now to computer 2 and i do the same thing in computer 1. All i want to do is to kill the session in computer 1 because i log-in in computer 2.

how to do that in asp.net?

View 7 Replies

Configuration :: Process.start (System.Diagnostics.Process) - Execute A Batch File

Sep 7, 2010

I've written a aspx.net(C#) page that after the user has done what they do on the page they hit a Submit button. The Submit button

1) takes the work the users was producing on the page and writes it to a file.
2) attempts to execute a batch file.

The call to the batch file is executed via:

protected void Execute123EDI()
{
try
{
string File = @"c:80sAdminSendV80s.bat";
lblCancelled.Text = lblCancelled.Text + File;
Process proc = new System.Diagnostics.Process();
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.LoadUserProfile = false;
proc.StartInfo.UserName = "administrator";
proc.StartInfo.RedirectStandardOutput = true;
System.Security.SecureString secPass = new System.Security.SecureString();
string paswd = "123abc";
for (int i = 0; i < paswd.Length; i++)
{
secPass.AppendChar(paswd[i]);
}
proc.StartInfo.Password = secPass;
proc.StartInfo.FileName = File;
proc.Start();
FileStream fs = new FileStream(@"c:80sAdminSendV80sOutput.log", FileMode.Append);
StreamWriter sw = new StreamWriter(fs);
sw.Write(proc.StandardOutput.ReadToEnd());
proc.WaitForExit();
sw.Close();
proc.Close();
}
catch(Exception ex)
{
lblDebug.Text = lblDebug.Text + ex.Message + "<br/>";
}

If I watch the processes tab in Task Manager on the web server I see "cmd.exe" under the context of 'administrator' but it just hangs. For test purposes c:SendV80s.bat: copy c: oot.ini c:zzz.txt

If I logon onto the webserver's console and execute SendV80s.bat it works and exits without issue. But when I execute the same batch file via the Submit button it gets stuck executing in Task Manager/Process. I believe this has something to do with the fact that cmd is not running in a full environment/desktop context. I just noticed this on the actual console of the webserver (not in my RDP console but console 0 instead)

A pop-up box stating: CMD.exe Application error The application failed to initialize properly (0xc0000142). Click OK to terminate the application. And when I click on the OK button my ASPX page's WaitForExit is satisfied and the continues processing normally.

View 2 Replies

Long Running HTTP Process - How To Put In Separate Process

Jul 21, 2010

I know that similar questions have been asked all over the place, but I'm having trouble finding one that relates directly to what I'm after.

I have a website where a user uploads a data file, then that file is transformed and imported into SQL. The file could be up to 50mb in size, and some times this process can take 30 minutes or sometimes even longer.

I realise I need to palm off the actual work to another process, and poll that process on the web page. I'm wondering what the best approach would be though? Being a web developer by trade, I'm finding all this new Windows Service stuff a bit confusing, and I just wanted somewhere to start.

So:

Can I do / should I being doing this with a windows service? if so, how?

Should I use WCF? If this runs under IIS, will I have problems with aspnet_wp.exe recycling and timing out my process?

clarifications

The data is imported into sql, there's no file distribution taking place.

If there is a failure, it absolutely MUST be reported to the user. The web page will poll every, lets say, 5 seconds, from the time the async task begins, to get the 'status' of the import. Once it's finished another response will tell the page to stop polling for status updates.

queries on final decision

ok, so as I thought, it seems that a windows service is the best idea. So as to HOW to get it to work, it seems the 'put the file there and wait for the service to pick it up' idea is the generally accepted way, is there a way I can start a process run by the service, without it having to constantly be checking a database table / folder? As I said earlier, I don't have any experience with Windows Services - I wondered if I put a public method in the service, can I call it somehow?

View 2 Replies

Execute A Process Remotely With System.Diagnostics.Process

Feb 26, 2010

I'm working on an ASP.net app I'm trying to execute a process remotely , using System.Diagnostics.Process class here's my code:

ProcessStartInfo startInfo = new ProcessStartInfo(@"C:TestCommand.exe");
startInfo.Domain = "myDomain";
startInfo.UserName = "MyUserName";
SecureString sec = new SecureString();
foreach (char item in "MyPassword")
{
sec.AppendChar(item);
}
sec.MakeReadOnly();
startInfo.Password = sec;
startInfo.UseShellExecute = false;
Process.Start(startInfo);

I keep receiving an exception with the message "Logon failure: unknown user name or bad password". Im absolutelly sure that i'm submiting my correct username/pwd

View 1 Replies

Web Forms :: The Process Cannot Access The File 'c: Empmy.pdf' Because It Is Being Used By Another Process?

Apr 3, 2010

I've developed a popup email .aspx used on our intranet based web app that is auto generated with .pdf's attached. I'm developing with VS 2008 ASP.Net 3.5 C# and System.Net.Mail.MailMessage. I can create and send the email with no issues. The problem is with any attempt to open or delete the attachments I get the above error. The .pdf's a copied with the following code:

FileStream fsr = new FileStream(inFilename, FileMode.Open, FileAccess.Read, FileShare.Read);
BinaryReader reader = new BinaryReader(fsr);
byte[] bytes = new byte[fsr.Length];
reader.Read(bytes, 0, bytes.Length);
FileStream fsw = new FileStream(outFileName, FileMode.Create, FileAccess.Write, FileShare.Write);
BinaryWriter writer = new BinaryWriter(fsw);
writer.Write(bytes, 0, bytes.Length);
// clean up
writer.Flush();
writer.Close();
writer = null;
fsw.Close();
fsw.Dispose();
fsw = null;
reader.Close();
reader = null;
fsr.Close();
fsr.Dispose();
fsr = null;
Later after sending the email I:
mailMessage.Dispose();
mailMessage = null;
foreach (string fileName in attachments)
{
if (File.Exists(fileName))
File.Delete(fileName);
}

The error occurs at: the File.Delete(fileName);

how I can delete or reopen these files after sending the email?

View 9 Replies

How To Recognize Whether The Process Is The IIS Worker Process From Within A .NET Code

Dec 25, 2010

Dear ladies and sirs.

I have a .NET infra code running both within the IIS worker process and within a desktop client app. How can the .NET code determine whether it is running within an IIS worker process?

I know that I could check the name of the process (w3wp.exe, for instance), but I would like a more robust approach. I wish to make a side note. This is not a production need. I need this information to enable certain scenarios useful during the development and testing phase. Specifically to ease the testing of secure vs non secure configurations.

View 3 Replies

C# - Tracking The Process Of A Singleton Process In A Web Application

Jan 26, 2010

When I hit the run button (in my Default.aspx), a process starts (this process contacts a webservice to get some files, etc). How do I: Ensure that only a single process is running at a time (i.e. if I refresh the browser, I don't want to start the process a second time)Track progress - there are 4 points of the process (at 25%, 50%, 75%, 100%) that I want to track, and when each part completes, I want to update the progress bar. I have a status object for the running process, but the question is how to update the progress bar automatically? Do I need to use threads to achieve the above two?

View 1 Replies

Web Forms :: Process Cannot Access The File It Is Being Used By Another Process?

Nov 6, 2010

My code is that I want to create a log file and log it upon a new user browsing the site. However, what i did was I put in a 6 second delay and then used another browser to access the page. And it threw an Exception saying it is being used by another process which is true. So how come I set it so that, if IT is being used by another process, WAIT and retry every 500 milliseconds until it becomes free/available?

here's the code:

protected void Page_Load(object sender, EventArgs e)
{if (!IsPostBack) // if this is the first time page loads, set k to 1
{ lognewuser();
}}

[Code]....

View 1 Replies

The Process Cannot Access The File 'C:inetpub' Because It Is Being Used By Another Process

Mar 28, 2011

I am having the text file which is used to track all the ip address which is available in the network and replace the content from"Reply from 172.29.116.3: bytes=32 time=1ms TTL=255" to 172.29.116.3.

For this task i am having 2 functions 1.runCMD() Function is used to create a file which ping all the ip address between 3 to 254 ("Reply from 172.29.116.3: bytes=32 time=1ms TTL=255").

2.Another function textFileReplace() which is used to replace the text from "Reply from 172.29.116.3: bytes=32 time=1ms TTL=255" to 172.29.116.3.

This process will continue every 30 minutes..

But i am having the error while accessing the function textFileReplace() as The process cannot access the file 'C:inetpub' because it is being used by another process.

View 4 Replies

SQL Server :: Error "Transaction (Process ID) Was Deadlocked On Lock Resources With Another Process And Has Been Chosen"

Jul 23, 2010

I have a stored procedure which fetches data after joining 8-9 tables and inserts that into a temp table. It was running fine till now, but now when the amount of data fetched have exceeded 20000, the SP is breaking. I have debugged the sp and found that this main query is failing after returning arround 15000-16000 records.

The error message says Transaction (Process ID) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. I know what is deadlock, but when i checked with SP_LOCK stored proc i only found that my process is running on database only. So how is this getting deadlocked when there are no other processes running simultaneously on server.

View 4 Replies

Process Can't Access File - Used By Another Process

Feb 10, 2010

When I delete all files from the directory path. then it will give me this error The process cannot access the file because it is being used by another process. How to solve this?

View 10 Replies

C# - The Process Cannot Access The File Because It Is Being Used By Another Process

May 12, 2010

I have an asp.net website and I allready did .Dispose() here is my code below;

try
{
MailMessage newMail = new MailMessage(MailFrom, MailTo,
MailSubject, MailMsg);
if (MailAttachment != "")
{
Attachment data = new Attachment(MailAttachment,
MediaTypeNames.Application.Octet);
newMail.Attachments.Add(data);
}
newMail.BodyEncoding = System.Text.Encoding.UTF8;
newMail.IsBodyHtml = true;
SmtpClient client = new SmtpClient("192.168.2.205");
client.Credentials = CredentialCache.DefaultNetworkCredentials;
client.Send(newMail);
newMail.Attachments.Dispose();
newMail.Dispose();
DeleteAttachment(MailAttachment);
lblSuccess.Text = "Başvurunuz alınmıştır teşekkürler.";
lblSuccess.Visible = true;
ClearForm();
}
catch (Exception ex)
{
lblSuccess.Text = ex.Message;
//lblSuccess.Text = "Bir sorun oluştu bir daha deneyiniz.";
lblSuccess.Visible = true;
}

But i' m getting the same error, it' s running fine in my localhost but in server i' m getting this error. How can i fix it?

View 2 Replies

C# - The Process Cannot Access The File Because It Is Being Used By Another Process?

Feb 8, 2010

I am getting binary data from a SQL Server database field and am creating a document locally in a directory my application has permissions. However I am still getting the error specified in the title. I have tried numerous suggestions posted on the web including those suggested in previous posts on Stackoverflow. I have also used ProcessExplorer > Find Handle to locate the lock and it returns nothing as if the file is not locked.

I am using the code below to save the file to the file system and I then try to copy this file to a new location later in the application process within another method. It is this copy method that takes the path of the newly created file that throws the exception.

The file itself is created with its content and i can open it through Windows Explorer without any problems.

Am I missing something completely obvious? Am I creating the file correctly from the database?

// Get file from DB
FileStream fs = new FileStream(
"C:myTempDirectorymyFile.doc", FileMode.OpenOrCreate, FileAccess.Write);
BinaryWriter br = new BinaryWriter(fs);
br.Write("BinaryDataFromDB");
fs.Flush();
fs.Close();
fs.Dispose();
// Copy file
File.Copy(sourceFileName, destinationFilename, true);

View 7 Replies

The Process Cannot Access The File Because It Is Being Used By Another Process?

Oct 5, 2010

Iam getting the above said error while Iam copying a file of relativelly Heavy say 130 MB.Below is the code which is giving the error.

System.IO.FileInfo FileInfo1 = new System.IO.FileInfo(filename1);
FileInfo1.CopyTo(strDestPath,true);

View 6 Replies

Process Cannot Access File Because It Is Being Used By Another Process

Feb 6, 2012

I am using a AsyncUpload(telerik), i am in a point where i am supposed to save the File to a certain Folder. First I check if the directory exist

Code:
Dim baseDire As String = Server.MapPath("~/MyFILES/")
If IO.Directory.Exists(baseDire & Request("Req_ID").ToString()) = False Then
IO.Directory.CreateDirectory(baseDire & Request("Req_ID").ToString())
End If

Because i am doing multiple Upload , i will have to loop through the items of the Upload control and save to a folder.

Code:
For Each file As UploadedFile In UploadPropDoc.UploadedFiles
Dim bytes(file.ContentLength - 1) As Byte
file.InputStream.Read(bytes, 0, file.ContentLength)
'Save the File to the disk
file.SaveAs(baseDire + file.GetName())
Next

Now when ever i debug this , when it comes to this line

Code:
file.SaveAs(baseDire + file.GetName())

I get an Error

The process cannot access the file because it is being used by another process.

I have removed the Readonly in the Folder that it supposed to write to and gave everyone permission , but still the error persist.

View 1 Replies

How To Set Folder Permissions With .NET

Feb 15, 2010

Is it possible to use a small .NET page to set folder permissions on some folders on the server where it resides? What is the code or objects that can be used for this? I am on Windows Server 2003.

Basically I want to hit the page with a GET or POST and have it run and check and/or update the permissions on a folder.

View 2 Replies

Required Permissions Cannot Be Acquired In 2.0

Aug 31, 2010

I am getting following error on uploading my pages on web server. it working file on my local machineRequired permissions cannot be acquired.
Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

[Code]....

View 2 Replies

Iis - ApplicationPoolIdentity Permissions On Temporary?

Jun 8, 2010

We have a web application that runs on a WIndows Server 2008 64 bits machine. The app's ApplicationPool is running under the ApplicationPoolIdentity and configured for .net 2 and Classic pipeline mode.

This works fine up to the moment that XmlSerialization requires creation of Serializer assemblies where MEF is being used to create a collection of knowntypes.

To remedy this I was hoping that granting the ApplicationPoolIdentity rights to the ASP.Net Temporary Files directory would be enough, but alas..

What I did was the run the following command from a cmd prompt:

icacls "c:windowsmicrosoft.netframework64v2.0.50727Temporary ASP.NET Files" /grant "IIS AppPoolMyAppPool":(M)

Obviously this did not work, otherwise you would not be reading this :)

Strange thing is that whenever I grant the Users or even more specific, the Authenticated Users Group those permissions, it works. What's weird as well (in my eyes) is that before I started granting access the ApplicationPoolIdentity was already a member of IIS_IUSRS which does have Modify rights for the temporary asp files directory.

And now I'm left wondering why this situation requires Modify rights for the Authenticated Users group. I thought it could be because the apppool account was missing additional rights (googling for this returned some results, so I tried those), but granting the ApplicationPoolIdentity modification rights to the WindowsTemp directory and/or the application directory itself did not fix it.

For now we have a workaround, but I hate that I don't know what is exactly going on here, so I was hoping any of you guys could shed some light on this.

View 3 Replies

ASP OleDB Permissions Error

Mar 24, 2011

I'm uploading an Excel file and then reading data using oledb connection in asp.net but I'm getting the following error: The Microsoft Jet database engine cannot open the file ''. It is already opened exclusively by another user, or you need permission to view its data.

Dim ocmd As New OleDbCommand("select * from [Sheet1$]", conn)
Line 12: conn.Open()
Line 13: Dim odr As OleDbDataReader = ocmd.ExecuteReader()
conn.open() line is red highlighted for error.

The excel file is uploaded successfully and present in the folder.

View 1 Replies

ADO.NET :: LINQ To SQL And User Permissions?

Aug 18, 2010

Can I use LINQ to SQL and have a user log in, and with that login be restricted to certain parts of the database.. basically having access to information located under their particular customer ID number.... how would I get the 'session' to follow them throughout the website without having to login each time the database is tapped for info...?

View 1 Replies

Security :: IIS Permissions For New AppPool ID?

Feb 11, 2010

I am doing some testing and want to find out best practice for creating a new user to assign to an appPool. I know that the default ASPNET account, on IIS 6.0, is very low permissions. For experienced folks, what are the bare permissions required to grant this new user? Yes, I am aware that various NTFS rights are required for different operations, such as reading outside of the application path, writing to the NTFS share, etc. I am just looking at a base install.

Dino Esposito wrote in Chapter 15 of Programming Microsoft ASP.NET 2.0 - Core Reference that the following directories would need the respective permissions:

.NET framework root - read/list Temporary ASP.NET folders - full GAC - read Windows System32 - access/read App root - access/read Web site root - scanWhat else would I need to set up beyond this base configuration as far as rights are concerned? If anyone does this regularly, do you have a script to do this automatically?

View 2 Replies

VS 02/03 Required Permissions Cannot Be Acquired

Sep 9, 2011

I've recently installed VS 2003 to work on an existing web project (I already had 2005 and 2008 installed), but I'm getting an annoying problem when I try to run it. I get a browser page with an error message of:

Code:
Required permissions cannot be acquired.It then pinpoints the problem as being in line 198 of my machine.config, which is:

Code:
<add assembly=*/>

I've changed the ASP.Net version to 1.1.4322 in the appropriate places, and other people in the team can run the project happily using an identical machine.config (they used a copy of mine).

View 3 Replies

Resetting A File's Security Permissions?

Sep 13, 2010

I've got a routine that tries to import files from an import directory, spitting them out to an Error directory if the import fails. The Error directory is shared and users have access permissions to delete files in there, so they can try to fix the problems and then move the files off to the import directory again. I use File.Move to move the files to the Error directory and this is working fine, apart from the permissions - it seems to revert to a default set of permissions, rather than the directory's one, and so the users can't remove the files - how can I reset the permissions on the file to those of their containing directory? I've tried poking around with SetAccessControl and SetAccessRuleProtection but I don't seem to be having any luck?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved