473,616 Members | 2,973 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

q; access to a remote file

\\MyRemoteServe r\F1\F2\F3\This PDF.pdf is accessible thought my IE browser,
so my user has access there.
However the following code gives "Logon failure: unknown user name or bad
password.\r\n"
I need to get this application run under a user that has access to
MyRemoteServer, how should I do this?

void dDialog(string sPath)
{

sPath="\\\\MyRe moteServer\\F1\ \F2\\F3\\This PDF.pdf";
System.IO.FileI nfo oFile;
try
{
oFile = new System.IO.FileI nfo(sPath);
Response.Clear( );
Response.AddHea der("Content-Disposition", "attachment ; filename=" +
oFile.Name);
Response.AddHea der("Content-Length", oFile.Length.To String());
Response.Conten tType = "applicatio n/octet-stream";
Response.WriteF ile(oFile.FullN ame);
}
catch (Exception ex)
{
Response.Write( "Exception: " + ex.Message);
}
finally
{
Response.End();
}
}

Sep 23 '06 #1
7 1467
The asp.net account must be a domain account to access UNC paths, so
impersonate a domain user who has access to both the server your codes on
and the one you wish to access.

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"JIM.H." <JI**@discussio ns.microsoft.co mwrote in message
news:E6******** *************** ***********@mic rosoft.com...
\\MyRemoteServe r\F1\F2\F3\This PDF.pdf is accessible thought my IE
browser,
so my user has access there.
However the following code gives "Logon failure: unknown user name or bad
password.\r\n"
I need to get this application run under a user that has access to
MyRemoteServer, how should I do this?

void dDialog(string sPath)
{

sPath="\\\\MyRe moteServer\\F1\ \F2\\F3\\This PDF.pdf";
System.IO.FileI nfo oFile;
try
{
oFile = new System.IO.FileI nfo(sPath);
Response.Clear( );
Response.AddHea der("Content-Disposition", "attachment ; filename=" +
oFile.Name);
Response.AddHea der("Content-Length", oFile.Length.To String());
Response.Conten tType = "applicatio n/octet-stream";
Response.WriteF ile(oFile.FullN ame);
}
catch (Exception ex)
{
Response.Write( "Exception: " + ex.Message);
}
finally
{
Response.End();
}
}

Sep 23 '06 #2
Thanks for the reply. Can you give me a site that shows how I can do it.

"John Timney (MVP)" wrote:
The asp.net account must be a domain account to access UNC paths, so
impersonate a domain user who has access to both the server your codes on
and the one you wish to access.

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"JIM.H." <JI**@discussio ns.microsoft.co mwrote in message
news:E6******** *************** ***********@mic rosoft.com...
\\MyRemoteServe r\F1\F2\F3\This PDF.pdf is accessible thought my IE
browser,
so my user has access there.
However the following code gives "Logon failure: unknown user name or bad
password.\r\n"
I need to get this application run under a user that has access to
MyRemoteServer, how should I do this?

void dDialog(string sPath)
{

sPath="\\\\MyRe moteServer\\F1\ \F2\\F3\\This PDF.pdf";
System.IO.FileI nfo oFile;
try
{
oFile = new System.IO.FileI nfo(sPath);
Response.Clear( );
Response.AddHea der("Content-Disposition", "attachment ; filename=" +
oFile.Name);
Response.AddHea der("Content-Length", oFile.Length.To String());
Response.Conten tType = "applicatio n/octet-stream";
Response.WriteF ile(oFile.FullN ame);
}
catch (Exception ex)
{
Response.Write( "Exception: " + ex.Message);
}
finally
{
Response.End();
}
}



Sep 23 '06 #3
http://msdn.microsoft.com/library/de...ersonation.asp

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"JIM.H." <JI**@discussio ns.microsoft.co mwrote in message
news:80******** *************** ***********@mic rosoft.com...
Thanks for the reply. Can you give me a site that shows how I can do it.

"John Timney (MVP)" wrote:
> The asp.net account must be a domain account to access UNC paths, so
impersonate a domain user who has access to both the server your codes on
and the one you wish to access.

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"JIM.H." <JI**@discussio ns.microsoft.co mwrote in message
news:E6******* *************** ************@mi crosoft.com...
\\MyRemoteServe r\F1\F2\F3\This PDF.pdf is accessible thought my IE
browser,
so my user has access there.
However the following code gives "Logon failure: unknown user name or
bad
password.\r\n"
I need to get this application run under a user that has access to
MyRemoteServer, how should I do this?

void dDialog(string sPath)
{

sPath="\\\\MyRe moteServer\\F1\ \F2\\F3\\This PDF.pdf";
System.IO.FileI nfo oFile;
try
{
oFile = new System.IO.FileI nfo(sPath);
Response.Clear( );
Response.AddHea der("Content-Disposition", "attachment ; filename=" +
oFile.Name);
Response.AddHea der("Content-Length", oFile.Length.To String());
Response.Conten tType = "applicatio n/octet-stream";
Response.WriteF ile(oFile.FullN ame);
}
catch (Exception ex)
{
Response.Write( "Exception: " + ex.Message);
}
finally
{
Response.End();
}
}



Sep 24 '06 #4
Thanks John. I put the following lines into Web.config and got the following
error. Is there anything else I need to do? I am suing APS.Net 1.1.

<identity impersonate="tr ue"
userName="domai n\user"
password="passw ord" />

Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.

Parser Error Message: Unrecognized configuration section 'identity'

=======

"John Timney (MVP)" wrote:
http://msdn.microsoft.com/library/de...ersonation.asp

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"JIM.H." <JI**@discussio ns.microsoft.co mwrote in message
news:80******** *************** ***********@mic rosoft.com...
Thanks for the reply. Can you give me a site that shows how I can do it.

"John Timney (MVP)" wrote:
The asp.net account must be a domain account to access UNC paths, so
impersonate a domain user who has access to both the server your codes on
and the one you wish to access.

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"JIM.H." <JI**@discussio ns.microsoft.co mwrote in message
news:E6******** *************** ***********@mic rosoft.com...
\\MyRemoteServe r\F1\F2\F3\This PDF.pdf is accessible thought my IE
browser,
so my user has access there.
However the following code gives "Logon failure: unknown user name or
bad
password.\r\n"
I need to get this application run under a user that has access to
MyRemoteServer, how should I do this?

void dDialog(string sPath)
{

sPath="\\\\MyRe moteServer\\F1\ \F2\\F3\\This PDF.pdf";
System.IO.FileI nfo oFile;
try
{
oFile = new System.IO.FileI nfo(sPath);
Response.Clear( );
Response.AddHea der("Content-Disposition", "attachment ; filename=" +
oFile.Name);
Response.AddHea der("Content-Length", oFile.Length.To String());
Response.Conten tType = "applicatio n/octet-stream";
Response.WriteF ile(oFile.FullN ame);
}
catch (Exception ex)
{
Response.Write( "Exception: " + ex.Message);
}
finally
{
Response.End();
}
}



Sep 24 '06 #5
You have to actually give the entries values, like the domain your user is
from and the actual username, and their password. Did you make the mistake
of copying it verbatim.

--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"JIM.H." <JI**@discussio ns.microsoft.co mwrote in message
news:E9******** *************** ***********@mic rosoft.com...
Thanks John. I put the following lines into Web.config and got the
following
error. Is there anything else I need to do? I am suing APS.Net 1.1.

<identity impersonate="tr ue"
userName="domai n\user"
password="passw ord" />

Configuration Error
Description: An error occurred during the processing of a configuration
file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.

Parser Error Message: Unrecognized configuration section 'identity'

=======

"John Timney (MVP)" wrote:
>http://msdn.microsoft.com/library/de...ersonation.asp

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"JIM.H." <JI**@discussio ns.microsoft.co mwrote in message
news:80******* *************** ************@mi crosoft.com...
Thanks for the reply. Can you give me a site that shows how I can do
it.

"John Timney (MVP)" wrote:

The asp.net account must be a domain account to access UNC paths, so
impersonate a domain user who has access to both the server your codes
on
and the one you wish to access.

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"JIM.H." <JI**@discussio ns.microsoft.co mwrote in message
news:E6******* *************** ************@mi crosoft.com...
\\MyRemoteServe r\F1\F2\F3\This PDF.pdf is accessible thought my IE
browser,
so my user has access there.
However the following code gives "Logon failure: unknown user name
or
bad
password.\r\n"
I need to get this application run under a user that has access to
MyRemoteServer, how should I do this?

void dDialog(string sPath)
{

sPath="\\\\MyRe moteServer\\F1\ \F2\\F3\\This PDF.pdf";
System.IO.FileI nfo oFile;
try
{
oFile = new System.IO.FileI nfo(sPath);
Response.Clear( );
Response.AddHea der("Content-Disposition", "attachment ; filename=" +
oFile.Name);
Response.AddHea der("Content-Length", oFile.Length.To String());
Response.Conten tType = "applicatio n/octet-stream";
Response.WriteF ile(oFile.FullN ame);
}
catch (Exception ex)
{
Response.Write( "Exception: " + ex.Message);
}
finally
{
Response.End();
}
}




Sep 24 '06 #6
re:
I put the following lines into Web.config and got the following
error. Is there anything else I need to do? I am suing APS.Net 1.1.
Please don't sue ASP.NET 1.1... ;-)

Seriously, check to see if

<identity impersonate="tr ue"
userName="domai n\user"
password="passw ord" />

is inside the <system.websect ion of web.config.

Also, check to see that it's not within another configuration section.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"JIM.H." <JI**@discussio ns.microsoft.co mwrote in message
news:E9******** *************** ***********@mic rosoft.com...
Thanks John. I put the following lines into Web.config and got the following
error. Is there anything else I need to do? I am suing APS.Net 1.1.

<identity impersonate="tr ue"
userName="domai n\user"
password="passw ord" />

Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.

Parser Error Message: Unrecognized configuration section 'identity'

=======

"John Timney (MVP)" wrote:
>http://msdn.microsoft.com/library/de...ersonation.asp

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"JIM.H." <JI**@discussio ns.microsoft.co mwrote in message
news:80******* *************** ************@mi crosoft.com...
Thanks for the reply. Can you give me a site that shows how I can do it.

"John Timney (MVP)" wrote:

The asp.net account must be a domain account to access UNC paths, so
impersonate a domain user who has access to both the server your codes on
and the one you wish to access.

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"JIM.H." <JI**@discussio ns.microsoft.co mwrote in message
news:E6******* *************** ************@mi crosoft.com...
\\MyRemoteServe r\F1\F2\F3\This PDF.pdf is accessible thought my IE
browser,
so my user has access there.
However the following code gives "Logon failure: unknown user name or
bad
password.\r\n"
I need to get this application run under a user that has access to
MyRemoteServer, how should I do this?

void dDialog(string sPath)
{

sPath="\\\\MyRe moteServer\\F1\ \F2\\F3\\This PDF.pdf";
System.IO.FileI nfo oFile;
try
{
oFile = new System.IO.FileI nfo(sPath);
Response.Clear( );
Response.AddHea der("Content-Disposition", "attachment ; filename=" +
oFile.Name);
Response.AddHea der("Content-Length", oFile.Length.To String());
Response.Conten tType = "applicatio n/octet-stream";
Response.WriteF ile(oFile.FullN ame);
}
catch (Exception ex)
{
Response.Write( "Exception: " + ex.Message);
}
finally
{
Response.End();
}
}




Sep 24 '06 #7
Hi Juan, I would not but the while application is written in1.1, will there
be any problem if I convert it to 2.0?

"Juan T. Llibre" wrote:
re:
I put the following lines into Web.config and got the following
error. Is there anything else I need to do? I am suing APS.Net 1.1.

Please don't sue ASP.NET 1.1... ;-)

Seriously, check to see if

<identity impersonate="tr ue"
userName="domai n\user"
password="passw ord" />

is inside the <system.websect ion of web.config.

Also, check to see that it's not within another configuration section.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"JIM.H." <JI**@discussio ns.microsoft.co mwrote in message
news:E9******** *************** ***********@mic rosoft.com...
Thanks John. I put the following lines into Web.config and got the following
error. Is there anything else I need to do? I am suing APS.Net 1.1.

<identity impersonate="tr ue"
userName="domai n\user"
password="passw ord" />

Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.

Parser Error Message: Unrecognized configuration section 'identity'

=======

"John Timney (MVP)" wrote:
http://msdn.microsoft.com/library/de...ersonation.asp

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"JIM.H." <JI**@discussio ns.microsoft.co mwrote in message
news:80******** *************** ***********@mic rosoft.com...
Thanks for the reply. Can you give me a site that shows how I can do it.

"John Timney (MVP)" wrote:

The asp.net account must be a domain account to access UNC paths, so
impersonate a domain user who has access to both the server your codes on
and the one you wish to access.

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"JIM.H." <JI**@discussio ns.microsoft.co mwrote in message
news:E6******** *************** ***********@mic rosoft.com...
\\MyRemoteServe r\F1\F2\F3\This PDF.pdf is accessible thought my IE
browser,
so my user has access there.
However the following code gives "Logon failure: unknown user name or
bad
password.\r\n"
I need to get this application run under a user that has access to
MyRemoteServer, how should I do this?

void dDialog(string sPath)
{

sPath="\\\\MyRe moteServer\\F1\ \F2\\F3\\This PDF.pdf";
System.IO.FileI nfo oFile;
try
{
oFile = new System.IO.FileI nfo(sPath);
Response.Clear( );
Response.AddHea der("Content-Disposition", "attachment ; filename=" +
oFile.Name);
Response.AddHea der("Content-Length", oFile.Length.To String());
Response.Conten tType = "applicatio n/octet-stream";
Response.WriteF ile(oFile.FullN ame);
}
catch (Exception ex)
{
Response.Write( "Exception: " + ex.Message);
}
finally
{
Response.End();
}
}




Sep 27 '06 #8

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

Similar topics

4
4689
by: Rene' Nielsen | last post by:
Context: Running Windows 2003 Server on an intranet. A web is configured with an anonymous access account that is a domain account that has been granted the desired access to a file on another server in the domain. An asp page in the web attempts to open (or any other access) the remote file and fails. Auditing is enabled on the remote system and for the file in question but no access denied records are being recorded.
6
3875
by: John | last post by:
Hi We have an access app (front-end+backend) running on the company network. I am trying to setup replication for laptop users who go into field and need the data synched between their laptops and the server upon return to the office. I am planning it this; Move all access tables to sql server and then link the tables to access front-end mdb app (using odbc?). Copy the same setup (access front end + sql backend) onto each laptop....
56
5947
by: Raphi | last post by:
Hi, I've been using an Access application I wrote for an office with the front-end stored on all computers and the back-end on one of them serving as an Access file server. Now we're moving to a 2nd office 15 minutes down the road. Only one office will be open at a time, so theoretically it'd be possible to copy the back-end manually every night from one office to another, but frankly, that's pretty annoying.
3
3486
by: Lyle Fairfield | last post by:
In a recent thread there has been discussion about Data Access Pages. It has been suggested that they are not permitted on many or most secure sites. Perhaps, that it is so, although I know of no site that has this prohibition, and I have uploaded DAPs to various sites and used them from those sites. I do not understand why any site manager would prohibit DAPs. To the best of my knowledge DAPs, as HTM files, are merely hosted on the...
0
3281
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool including SourceOffSite, SourceAnyWhere and VSS Remoting This article makes a detailed comparison among SourceAnyWhere, SourceOffSite, VSS Remoting and possible others.
3
2745
by: Daniel | last post by:
Is it possible to retain local file system read, write, delete access while impersonating for access to a remote drive in a different domain? I need to be able to move files from a local computer to a remote computer. do i have to copy them from the local computer to the remote computer then delete them fromt the local computer after undo-ing the impersonation? Or is there a way to retain access to both the local computer and the remote...
1
8121
by: Duffman | last post by:
Hi, I have what seems to be a common problem, but the solutions I've found don't seem to work. I would like to use a web service to create a file at a UNC location in a shared file. Currently I'm just running it locally and saving the file locally using my machines UNC path. I have given user ASPNET full control over the folder I want to write the file to. I've also tried using the web config identity impersonation to use my user...
13
1558
by: Bob Palank | last post by:
Remote server hosts a .mdb file but the client cannot access the DB through VB.Net Express 2005. My Assumptions: 1. One can use VB.Net Express 2005 to write a client resident application to access an .mdb file living on a remote server. 2. No Microsoft Access code elements need to reside on the remote server except the *.mdb file. 3. On the remote server, permissions need be set so that anyone can have read access to that Access...
1
6654
by: TerrenceJ | last post by:
Hi there I've configure our SBS 2003 server to allow remote access and Outlook over internet. The mail works fine, but when I try remote access, I am asked for username and password, which I complete and then I get this error. ____________________________________ Access to the path "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\remote\3f1585d2\3070828a" is denied. Description: An unhandled exception occurred...
7
1916
by: =?Utf-8?B?a21jY29za2V5?= | last post by:
I'm trying to access an access database on the file server from a web server using asp.net and IIS 6.0. I can do it when I have anonymous access enabled in IIS 6.0 as in the public internet web site style. I want to do the same with the intranet setup where IIS 6.0 is not setup to allow anonymous access. The way the intranet works is the user authenticates to the IIS 6.0 web server through group membership in an active directory domain. ...
0
8647
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8297
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7121
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6097
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5550
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2579
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1445
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.