请问这个功能怎么实现,用javascript

解决方案 »

  1.   

    下面的示例将文件从 http://www.contoso.com 下载到本地硬盘。
    [Visual Basic] 
    Dim remoteUri As String = "http://www.contoso.com/library/homepage/images/"
    Dim fileName As String = "ms-banner.gif"
    Dim myStringWebResource As String = Nothing
    ' Create a new WebClient instance.
    Dim myWebClient As New WebClient()
    ' Concatenate the domain with the Web resource filename. Because DownloadFile 
    'requires a fully qualified resource name, concatenate the domain with the Web resource file name.
    myStringWebResource = remoteUri + fileName
    Console.WriteLine("Downloading File ""{0}"" from ""{1}"" ......." + ControlChars.Cr + ControlChars.Cr, fileName, myStringWebResource)
    ' The DownloadFile() method downloads the Web resource and saves it into the current file-system folder.
    myWebClient.DownloadFile(myStringWebResource, fileName)
    Console.WriteLine("Successfully Downloaded file ""{0}"" from ""{1}""", fileName, myStringWebResource)
    Console.WriteLine((ControlChars.Cr + "Downloaded file saved in the following file system folder:" + ControlChars.Cr + ControlChars.Tab + Application.StartupPath))
    [C#] 
    string remoteUri = "http://www.contoso.com/library/homepage/images/";
    string fileName = "ms-banner.gif", myStringWebResource = null;
    // Create a new WebClient instance.
    WebClient myWebClient = new WebClient();
    // Concatenate the domain with the Web resource filename.
    myStringWebResource = remoteUri + fileName;
    Console.WriteLine("Downloading File \"{0}\" from \"{1}\" .......\n\n", fileName, myStringWebResource);
    // Download the Web resource and save it into the current filesystem folder.
    myWebClient.DownloadFile(myStringWebResource,fileName);        
    Console.WriteLine("Successfully Downloaded File \"{0}\" from \"{1}\"", fileName, myStringWebResource);
    Console.WriteLine("\nDownloaded file saved in the following file system folder:\n\t" + Application.StartupPath);
      

  2.   

    ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/cpref/html/frlrfSystemNetWebClientClassDownloadFileTopic.htm
      

  3.   

    sorry
    刚才 发错了 
    下面 这个 是<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title> New Document </title>
    <meta name="Author" content="">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    <script>
    function mdown()
    {
    if(event.button == 2)
    {
    window.location.href="http://www.aspxboy.com";
    }
    }
    </script>
    </head>
    <body onmousedown="mdown()" oncontextmenu="return false;"></body>
    </html>
      

  4.   

    TO:xiahouwen(武眉博<活靶子.NET>) 我希望是左键点击,但你的那个是右键,请问怎么弄?谢谢