473,322 Members | 1,421 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,322 software developers and data experts.

it is a web application

Hi,
i want access file in another system with in my system.How to connected to 2nd system in dotnet.
Ex:server name:sudheer drive:d:/documents and settings/aspnet.pdf
my system:sever:administrator

i want to access this file in my system.How is it possible.please send the code if possible asap.
Thank you so much.
Jan 29 '08 #1
9 1506
leoiser
41
I think you dont ve proper access right..

Did u add account for annoymus/IIS user in that folder?

Hi,
i want access file in another system with in my system.How to connected to 2nd system in dotnet.
Ex:server name:sudheer drive:d:/documents and settings/aspnet.pdf
my system:sever:administrator

i want to access this file in my system.How is it possible.please send the code if possible asap.
Thank you so much.
Jan 29 '08 #2
mzmishra
390 Expert 256MB
You should be able to access the file using the server name and shared folder, like this \\ServerName\SharedFolder\YourFile.txt.

string path = @"\\ServerName\SharedFolder\MyTest.txt";
try {
if (File.Exists(path)) {
// File exists, then do something with it
}
}
Jan 29 '08 #3
You should be able to access the file using the server name and shared folder, like this \\ServerName\SharedFolder\YourFile.txt.

string path = @"\\ServerName\SharedFolder\MyTest.txt";
try {
if (File.Exists(path)) {
// File exists, then do something with it
}
}


Hi,
thanks for the information.

i wrote the code like this.
Expand|Select|Wrap|Line Numbers
  1. string path=@"\\administrator\d\raja\aspnet.doc";
  2. string type = Path.GetExtension(path); 
  3. if (type == ".pdf")
  4.             {
  5.                 Response.ContentType = "application/pdf";
  6.             }
  7.             else if (type == ".jpg" || type == ".jpeg")
  8.             {
  9.                 Response.ContentType = "image/jpeg";
  10.             }
  11.             else if (type == ".gif")
  12.             {
  13.                 Response.ContentType = "image/gif";
  14.             }
  15.             else if (type == ".doc")
  16.             {
  17.                 Response.ContentType = "application/msword";
  18.             }
  19.             else if (type == ".xls")
  20.             {
  21.                 Response.ContentType = "application/vnd.ms-excel";
  22.             }
  23.             else if (type == ".txt")
  24.             {
  25.                 Response.ContentType = "text/html";
  26.                 //response.contenttype = "application / vnd.text";
  27.             }
  28.             else if (type == ".htm" || type == ".html" || type == ".asp")
  29.             {
  30.                 Response.ContentType = "text/html";
  31.             }
  32.             else if (type == ".mdb")
  33.             {
  34.                 Response.ContentType = "application/vnd.ms-access";
  35.             }
  36.             else if (type == ".bmp")
  37.             {
  38.                 Response.ContentType = "images/bmp";
  39.             }
  40.             else if (type == "")
  41.             {
  42.                 Response.Write("file type must be match");
  43.             }
  44.             Response.WriteFile(path);
  45.             Response.End();
  46.             Response.Close();

here it is showing error like this:The network path was not found.

please give me the solution for this asap.
Thaks you so much.
Jan 29 '08 #4
You should be able to access the file using the server name and shared folder, like this \\ServerName\SharedFolder\YourFile.txt.

string path = @"\\ServerName\SharedFolder\MyTest.txt";
try {
if (File.Exists(path)) {
// File exists, then do something with it
}
}


hi,
Here it is showing error like this:Logon failure: unknown user name or bad password.


where can i provide the password.
please give me the reply asap.
Jan 29 '08 #5
please send me solution asap.
Thanking you
Jan 30 '08 #6
kenobewan
4,871 Expert 4TB
I believe that we are back to folder permissions again. Did you give aspnet access rights to the folder?
Jan 30 '08 #7
I believe that we are back to folder permissions again. Did you give aspnet access rights to the folder?

No.I don't know how to give the permissions to the folder.Please give me the idea how to give the permissions to folder.I'm expecting reply soon from you.
Thanks for giving the solution.
Jan 31 '08 #8
kenobewan
4,871 Expert 4TB
Exact method depends on OS, but right click on the folder > properties > sharing > add ASPNET account > confirm.
Jan 31 '08 #9
Exact method depends on OS, but right click on the folder > properties > sharing > add ASPNET account > confirm.
hi,
it is not working.It is showing path is in correct manner.please let me know the solution asap.
Feb 1 '08 #10

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

Similar topics

9
by: J. Baute | last post by:
I'm caching data in the Application object to speed up certain pages on a website The main reason is that the retrieval of this data takes quite a while (a few seconds) and fetching the same data...
3
by: Amit Dedhia | last post by:
Hi I am developing a Dot net application (involving image processing) on a uni processor. It works well on my machine. I then take all my code on a multi processor, build and run the application...
6
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are...
20
by: Peter Oliphant | last post by:
How does one launch multiple forms in an application? Using Photoshop as an example, this application seems to be composed of many 'disjoint' forms. Yet, they all seem somewhat 'active' in...
6
by: Josef Brunner | last post by:
Hi, I published my application (VS 2005) and am now trying to install it when I get this error message. It worked before...even on a different machine. Here is the detailed description: ...
9
by: jeff | last post by:
Hi All. I realize that when my Deployed winforms application starts, Windows needs to load the .net 2 framework before control is given to my application.... Is there anyway to either ... -...
3
by: asadikhan | last post by:
Hi, I have written a windows application with a GUI (let's call it MENU). I own the code for this application and have access to it. We have another application that is a third-part windows...
2
by: Michael Kalika | last post by:
Hi, We have developed a VSTO 2005 Excel application and we would like to leverage ClickOnce deployment mechanism for distribution of this application. How can we do that? I was digging in MSDN...
0
by: Tifer | last post by:
Hello, I am building my first .Net Application. The first couple of Publish and Installs I did went fine. But after a couple of builds, I get a modal dialogue box error every time upon trying...
4
by: Dave | last post by:
I have a global.asax file with Application_Start defined and create some static data there and in another module used in the asp.net application and I realize that static data is shared amongst...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.