.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
abhays
Clintonzz
arronlee
mattyclown
cathyhill345
Post New Web Links

Hyperlink to a local file.

Posted By:      Posted Date: October 02, 2010    Points: 0   Category :ASP.Net
 

There is a hyperlink to a local file...for instance....C:/text.txt. This is not possible, because ASP.net does not allow links to local files. But, links to files on network drives such as W:/test.txt are working ok.

My question is... how does the browser know which drive letter is local, and which is networked? How does it know that C: is local or D: is local etc, and that W: is a network drive? 




View Complete Post


More Related Resource Links

hyperlink to a local file

  

Hi guys,

I tried to create a hyperlink in c# web application.  This hypelink is linking to a file in my computer.  When I click on the hypelink, it should open a new window with the file.  Here is my code:

<asp: hyperlink id="hyperlink1" runat="server" target="_blank" NavigateUrl="file:///d:\checklist.doc">Check List</asp:hyperlink>

But the new window never show up.  If I change the link to http site or network file, it works fine.  I developed this code in Visual Studio 2003.  I wrote a html file with html hyperlink to this local file, it works fine:

<a href="D:\AUS Leave Form - Melbourne.doc">link</a>

But if I add this code in apsx file, the html hyperlink is not working too.

I did search on internet without luck.  I need to fix it in a short time.  I really appreciate any comment.

Thank you,

David


Trying to launch a .exe file on my local computer from intranet site.

  

I have been told I can launch a local program on my PC from my intranet site but it has to be done with Active X or vbscript and not javascript.  I found the following little sample html code that will launch notepad.  However, I cannot figure out how to put this in a button, etc., within my aspx or code behind to execute it.  Does anybody have any idea how to do this?  I have a lot of javascript code I am launching urls with and I have even tried using that but again, I have been told that to do it client side it needs to be vbscript or something like this.  Any ideas?

<html>
  <head>
  <title>Web page that runs EXE files</title>
  </head>
  <body>
  <h1>Web page that runs EXE files</h1>
  <p>Click <a href="file:///C:/windows/notepad.exe" class="navbar">here</a>
  to run notepad.exe (Windows XP, ME, 98, 95)</p>
  <p>Click <a href="file:///C:/winnt/notepad.exe" class="navbar">here</a>
  to run notepad.exe (Windows 2000, NT)</p>
  </body>
  </html>


 


hyperlink and swf file

  
Hi guys, i have a problem not abling to hyperlink an swf file: <asp:hyperlink navigateurl=~/page.aspx......> <embed src=movie.swf........></embed> </asp:hyperlink> The above code isnt working, i need all the flash to be a hyperlink to other file. I want a solution in visual web developer not in macromedia flash by editing the .fla project file. I know the solution is in javascript code with something like "onclick=..." but i dont know how to implement it..... thx for any help!

Open PDF file on button click or hyperlink from asp.net

  
I want to open a .PDF file on button click or hyperlink. please help me.

Accessing image file in local machine from server

  
 Hi i have a  .JPG file in my local machine which has  to be sent as body of SMTP mail. Path of image D://foldername//imagename.jpg The code I run is in the server m\c. I want it to access my local machine's d:\ folder to get the image file. But it is accessing the server m\c's d:\ folder. How can this be done? Thanks Amuda.RG  

How to Download a file with a hyperlink

  
I have been all over the net reading samples to this, they are not for ASP 2.0 or the example code given does not work. So could someone PLEASE put this simple thing in black and white?  Assuming you have created a blank aspx lets say Downloading.aspx and are going to hyperlink from links.aspx... and all your files that you want available for the client to download are stored in a public folder on your domain lets say mydomain/downloadstuff. 1. Example of hyperlink to use on links.aspx   2. Code to use on downloading.aspx (assume to use the octet thing that supports all types of files) and does the code go in downloading.aspx or downloading.aspx.vb   thanks, Brad Zynda

uploading a file with wcf works fine with local drive, but only 4096 kb uploaded when I use unc stor

  
Hello I'm writing a wcf service for uploading files to a server. It works fine when I try to upload the file to the servers local c:/ drive, but if I use a UNC path only 4096 kb is stored. It actually looks like part of the file is lost while storing it with writeStream.Write(buffer, 0, bytesRead);, because I wrote the bytesread to an sql table and the number of elements are always the same no matter how many times I upload the file, but the stored file is always different sizes, ranging from 1996 kb to 4092 kb.   I'm using IIS 7.5 on a windows 7 enterprise machine. My IIS is using a administrator account for the application pool, so it should not be a problem with permissions.   My wcf method uses Stream to upload the file in chunks    public void UploadFile(RemoteFileInfo request)         { //some methods to set the filepath                                   int chunkSize = 4096;                                 byte[] buffer = new byte[chunkSize];                                 Stream writeStream = new FileStream(filePath, FileMode.CreateNew, FileAccess.Write);  &

Downloading a document from a sharepoint site to local file system, copy web service returns null

  
Hi Guys,
               I am trying to get this done for the last 2 days and I am still banging my head to the wall.
All I need to do is to download files from my sharepoint site library that uses integrated windows authentication. I was using copy webservice : getItem method to accomplish this.

CopyService.GetItem(copySource, out myFieldInfoArray, out myByteArray);

Problem : myByteArray is always returned as NULL

Note: I have tried the same with another site that uses forms authentication but the result was the same (NULL !!)


This is my code:

CopyService.

Copy copy = new CopyService.Copy();

 

Error: Could not load file or assembly 'file:///C:\Users\xxxxx\AppData\Local\Temp\Temporary ASP.NET

  

Hi,

I am getting the following error when traying to run a web application project on VS2008, 3.5 sp1.

Error    1    Could not load file or assembly 'file:///C:\Users\xxxxx\AppData\Local\Temp\Temporary ASP.NET Files\website6\729e7299\82e765ff\App_Web_8ysocxbb.dll' or one of its dependencies. The system cannot find the file specified.  


In solution Explorer,  right click on Default.aspx ->  View in Browser, the following error appears on the web page in browser.


The resource cannot be found.

Server Error in '/WebSite6' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /WebSite6/Default.aspx



Version Information: Microsoft .NET Framework Version:2.0.50727.4952; AS

How to open XML file from ASP Hyperlink control

  

How can I open a XML file from the location mentioned in the web.config file using Hyperlink control?

I have an aspx page with hyperlink control and in code behind I do the following:

hypLink.Text = "Transformed XML";
hypLink.NavigateUrl = ConfigurationSettings.AppSettings["OutputXML"];

Web.config file looks like:

<add key="OutputXML" value="C:\Working\MyTest\XMLTransform\App_Data\Transformed.xml"/>


This code is not working. In IE, it doesn't do anything but in FF, it throws a error box with message that the "FF doesn't know how to open this address..."


Creating Local cube file using ASSL

  

Hi All,

I am looking to create a local cube by using ASSL. I didn't find much help on this. Please brief me the steps on how to create the local cube file using ASSL.

Thanks in Advance.


Move folder from file share to local C:/ drive on same box

  

Hello,

I need to copy a folder from a file share to my local C: drive. Is there an easy way to do this in SSIS, or do I have to write a DOS batch file and execute it from SSIS.

Any help would be appreciated

Dave


Dave SQL Developer

getting text from local .txt file to Textbox.

  

Ok, So I've read that its impossible to get the client computer name (If your website is in a different server) I've tried it all but all (I guess) I got was the Router Computer name.

my project is for INTRANET use...

so.. I tried cheating.. please guide me here.

What I want to do is store the computername of the workstation in a textfile and import it in a textbox so I can later on insert it in a database.

Here's my code

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim FILE_NAME As String = "file:///C:/test.txt"
        Dim objReader As New System.IO.StreamReader(FILE_NAME)
        TextBox1.Text = TextBox1.Text & objReader.ReadToEnd

    End Sub

Will My idea work at all?



How to create and use both local and global resource file in a page in VB.NET?

  

Hi all,

 

    I need to create both local and global resource file in VB.NET. And also i need to use both resource file in a single page. Please help me how to create and use in VB.NET (VS2008).


Thanks!


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend