473,397 Members | 2,028 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,397 software developers and data experts.

asp.net 2.0 dev using VS 2005!


Hello,
when i runan app under VS 2005using the built in web server, which user is
my web application running under?

Many thanks
JJ
Oct 19 '06 #1
6 1020
Should be the currently logged-in Windows user, you can verify using:
Response.Write(User.Identity.Name);

--
Chris Fulstow
MCP, MCTS
http://chrisfulstow.blogspot.com/

Jens Jensen wrote:
Hello,
when i runan app under VS 2005using the built in web server, which user is
my web application running under?

Many thanks
JJ
Oct 19 '06 #2
Its you, or better described as " the page runs in the context of your
current user account " whihc is whatever account yourt logged in with when
you run the app through the server.

read about it here:
http://msdn2.microsoft.com/en-us/library/58wxa9w5.aspx

If you want to check it, heres a bit of code that will tell you who you are:

one import

and 4 labels, stick this code in the page load event

lbl1.Text = "'" + User.Identity.Name + "'";

lbl2.Text = WindowsIdentity.GetCurrent().Name;

bool fred = ((WindowsIdentity)User.Identity).IsAnonymous;

lbl3.Text = fred.ToString();

lbl4.Text = Request.LogonUserIdentity.Name.ToString();

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"Jens Jensen" <jj@jensen.dkwrote in message
news:uW**************@TK2MSFTNGP05.phx.gbl...
>
Hello,
when i runan app under VS 2005using the built in web server, which user is
my web application running under?

Many thanks
JJ

Oct 19 '06 #3
Then then maybe you can help me solve the problem below:

**************************

I use the code below to zip files to a single .zip destination. I get the
expected result when i work on my developement machine (WinXP sp.2).

When i deploy the web application which host the code on win2k3 , it only
works for a single file.

I gave the modify right to "Noetwork Service" on the folder i'm writing to.
It does not help.

Can someone tell me what i'm doing wrong?
Code below:
protected void ZipWithExternalBatch(string input_file)

{

try

{

System.Diagnostics.Process job = new System.Diagnostics.Process();

job .StartInfo.FileName = "pkzip.exe";

job .StartInfo.Arguments = "-add " +
ConfigurationManager.AppSettings["TargetZipFile"].ToString()+ " " +
Server.MapPath(input_file);

job .StartInfo.UseShellExecute = false;

job .StartInfo.RedirectStandardOutput = true;

job .Start();

job .StandardOutput.ReadToEnd();

job.WaitForExit();

catch (Exception ex)

{

AppLog.Write(ex);

}
************

"John Timney (MVP)" <x_****@timney.eclipse.co.ukskrev i en meddelelse
news:oO********************@eclipse.net.uk...
Its you, or better described as " the page runs in the context of your
current user account " whihc is whatever account yourt logged in with when
you run the app through the server.

read about it here:
http://msdn2.microsoft.com/en-us/library/58wxa9w5.aspx

If you want to check it, heres a bit of code that will tell you who you
are:

one import

and 4 labels, stick this code in the page load event

lbl1.Text = "'" + User.Identity.Name + "'";

lbl2.Text = WindowsIdentity.GetCurrent().Name;

bool fred = ((WindowsIdentity)User.Identity).IsAnonymous;

lbl3.Text = fred.ToString();

lbl4.Text = Request.LogonUserIdentity.Name.ToString();

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"Jens Jensen" <jj@jensen.dkwrote in message
news:uW**************@TK2MSFTNGP05.phx.gbl...
>>
Hello,
when i runan app under VS 2005using the built in web server, which user
is my web application running under?

Many thanks
JJ


Oct 19 '06 #4
For some reason , the string

User.Identity.Name is empty on the server but returns the my user login name
on the developement server.

Hummmm?

Oct 19 '06 #5
Process.start is never easy to work with as its hard to gauge the impact of
calling any exe from the asp.net account. If I was you, I would look at
impersonation, and impersonate an actual user rather than relying on the
service account, that way like on your development machine the code will be
running as you.

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"Jens Jensen" <jj@jensen.dkwrote in message
news:Od**************@TK2MSFTNGP04.phx.gbl...
Then then maybe you can help me solve the problem below:

**************************

I use the code below to zip files to a single .zip destination. I get the
expected result when i work on my developement machine (WinXP sp.2).

When i deploy the web application which host the code on win2k3 , it only
works for a single file.

I gave the modify right to "Noetwork Service" on the folder i'm writing
to.
It does not help.

Can someone tell me what i'm doing wrong?
Code below:
protected void ZipWithExternalBatch(string input_file)

{

try

{

System.Diagnostics.Process job = new System.Diagnostics.Process();

job .StartInfo.FileName = "pkzip.exe";

job .StartInfo.Arguments = "-add " +
ConfigurationManager.AppSettings["TargetZipFile"].ToString()+ " " +
Server.MapPath(input_file);

job .StartInfo.UseShellExecute = false;

job .StartInfo.RedirectStandardOutput = true;

job .Start();

job .StandardOutput.ReadToEnd();

job.WaitForExit();

catch (Exception ex)

{

AppLog.Write(ex);

}
************

"John Timney (MVP)" <x_****@timney.eclipse.co.ukskrev i en meddelelse
news:oO********************@eclipse.net.uk...
>Its you, or better described as " the page runs in the context of your
current user account " whihc is whatever account yourt logged in with
when you run the app through the server.

read about it here:
http://msdn2.microsoft.com/en-us/library/58wxa9w5.aspx

If you want to check it, heres a bit of code that will tell you who you
are:

one import

and 4 labels, stick this code in the page load event

lbl1.Text = "'" + User.Identity.Name + "'";

lbl2.Text = WindowsIdentity.GetCurrent().Name;

bool fred = ((WindowsIdentity)User.Identity).IsAnonymous;

lbl3.Text = fred.ToString();

lbl4.Text = Request.LogonUserIdentity.Name.ToString();

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"Jens Jensen" <jj@jensen.dkwrote in message
news:uW**************@TK2MSFTNGP05.phx.gbl...
>>>
Hello,
when i runan app under VS 2005using the built in web server, which user
is my web application running under?

Many thanks
JJ



Oct 19 '06 #6
Many thank for you valuable input.

JJ
Oct 20 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: neha | last post by:
hi, i m trying to integrate python with apache on linux.For this i m using mod_python. I dont see any problem with the versions of python,apache and mod_python i m using. the versions i m using...
6
by: charliewest | last post by:
Can someone pls point me to or recommend the easiest way to calculate someone´s age using the TimeSpan object, in .NET CF? Isn´t there a simple way to use the TimeSpan object to calculate the...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
8
by: Mike Owen | last post by:
Hi, I am trying to pre-compile a project prior using ASP.Net 2.0, VS 2005, to putting it onto a live server. The reason for doing this is that other people have access to the server, and I...
5
by: AliR | last post by:
Hi Everyone, I have a Visual C++ MFC program, and I am trying to use a webservice written in C#. When I add the webservice to my project using Add Web Reference the sproxy compiler complains...
0
by: ME | last post by:
I can't seem to delete records using an objectdatasource. The object is a Typed Collection built by Visual Studio that access a SQL Database. When I try to delete using the ObjectDataSource it...
3
by: den 2005 | last post by:
Hi everybody, Can VS 2005 Express Edition run side-by-side without affecting each others projects and applications, new and existing ones? Can you provide info link where it is stated? Can I...
3
by: Tom | last post by:
I'm building a web application using VS 2005. This application uses Windows authentication to 'authenticate'. However, when I test it (debug) via the VS 2005 built-in test server, it doesn't work....
1
by: swethak | last post by:
hi, i have a code to disply the calendar and add events to that. It works fine.But my requirement is to i have to disply a weekly and daily calendar.Any body plz suggest that what modifications i...
13
by: ramprakashjava | last post by:
hi, i hav "java.lang.NullPointerException" error while Deleting table records using checkbox in jsp here i enclosed files help quickly plzzz.. ...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.