ProcessStartInfo psi=new ProcessStartInfo(@"c:\filetest\ww.doc");
Process p=new Process();
p.StartInfo=psi;
p.Start();

解决方案 »

  1.   

    //抱歉
    using System.Diagnostics;
    public class main
    {
    public static void Main()
    {
    ProcessStartInfo psi=new ProcessStartInfo(@"c:\filetest\ww.doc");
    Process p=new Process();
    p.StartInfo=psi;
    p.Start(); 
    }
    }
      

  2.   

    你是想在ASP.Net下还是C#下打开Work啊?
      

  3.   

    ASP.NET!用C#!那可是Server端的代码!打开Client端的word文件?还要用绝对路径!
    首先,Server端运行的代码能打开client端的程序吗?除非是script,运行于client端。
    其次,写这样的代码安全吗?如果IE允许你随便用client端Process,MS一定疯了。
    如果哪个用户居然打开这样的权限,他一定疯了。
      

  4.   

    呵呵,是啊,我都快疯了!但是把script放进Response.Write()的确能打开client端的WORD文件,不知道能不能用绝对路径?Dylan,拜托了!真是焦头烂额!
      

  5.   

    今天比较忙,所以才来。
    解决的方法很长,这里说思路给你听:
    1、共需要3个文件
    2、wfmMain主窗体;你在这里点击某个按钮打开一个窗口。windows.open或者是一个dialog也可以。
    3、htmFrame框架窗体;这个HTML文件里什么也没有,只是有一个frame,这个frame引用的是wfmFile文件。
    4、wfmFile窗体;这个窗体要接收wfmMain传递过来的路径参数。然后读出来,直接使用Response.Write()上就行。
      

  6.   

    这么复杂啊,不懂。快把你的方法告诉我吧,急死了!
    [email protected]
      

  7.   

    zzgsky(紫雨),mappath() 怎样使用?
    pp616(平平),不要幸灾乐祸,给点意见!
      

  8.   

    MapPath Example
    For the examples below, the file data.txt is located in the directory, C:\Inetpub\Wwwroot\Script, as is the test.asp file that contains the following scripts. The C:\Inetpub\Wwwroot directory is set as the server's home directory.The following example uses the server variable PATH_INFO to map the physical path of the current file. <%= Server.MapPath(Request.ServerVariables("PATH_INFO"))%><BR>
     
    The preceding script produces the outputc:\inetpub\wwwroot\script\test.asp<BR>
     
    Because the path parameters in the following examples do not start with a slash character, they are mapped relative to the current directory, in this case C:\Inetpub\Wwwroot\Script. <%= Server.MapPath("data.txt")%><BR>
    <%= Server.MapPath("script/data.txt")%><BR>
     
    The preceding scripts produce the following outputc:\inetpub\wwwroot\script\data.txt<BR>
    c:\inetpub\wwwroot\script\script\data.txt<BR>
     
    The next two examples use the slash characters to specify that the path returned should be looked up as complete virtual paths on the server. <%= Server.MapPath("/script/data.txt")%><BR>
    <%= Server.MapPath("\script")%><BR>
     
    The preceding scripts produce the following outputc:\inetpub\wwwroot\script\data.txt<BR>
    c:\inetpub\wwwroot\script<BR>
     
    The following examples demonstrate how you can use either a forward slash (/) or a backslash (\) to return the physical path to the home directory of the Web site root. <%= Server.MapPath("/")%><BR>
    <%= Server.MapPath("\")%><BR>The preceding scripts produce the following outputc:\inetpub\wwwroot<BR>
    c:\inetpub\wwwroot<BR>The following examples demonstrate how you can use relative pathing to return the relative physical path to the page that is being viewed in the web browser.<%= Server.MapPath("../")%><BR>
    <%= Server.MapPath("..\")%><BR>
      

  9.   

    我搞不清楚你到底想干什么,是想把client的文件名作为参数传到Response.write中吗?
    好像有办法,让我试试。
      

  10.   

    我是要client端的IE打开存放在SERVER端的文件(绝对路径)。
      

  11.   

    gust99(阿呆),你好,最近较忙,不过你的这种想法最好放弃,不论从哪方面讲。client端的IE打开存放在SERVER端的文件(绝对路径)都是不太合理的。
    不过,希望有识之士能提出高见。
      

  12.   

    不是不合理,是根本就不可能!
    访问Server上的绝对路径下的文件,这不是黑客行径吗?正常的HTTP怎么可能提供这样的方法!
    大致情况是: Server端代码(ASP.NET)可以访问Server端文件,基本不存在安全限制。
                Client端代码(script)可以访问Client端文件,需要设置一定的安全限制(不推荐)。
                Server端代码不可能随意访问Client端文件。
                Client端代码可以通过URL访问Server上的文件,但绝对路径不行。
     
      

  13.   

    谢谢qqchen79的指点!看来我是一直在干一件不可能实现的傻事!
    但这个问题还是要解决,如果用虚拟路径,那Client端就随意通过IE访问该文件,这是我不愿意看到的!有没有变通的办法,我想用户通过我的界面来打开存放在服务器的文件。谢谢各位的帮助!再加100分,欢迎大家继续讨论!
      

  14.   

    程序中要定义类和对象,并且要使用类和对象!!! 因为程序的目的就是为了展现面向对象的特点和优点!!!
    假定: 对一家公司的员工进行管理:
    包括人员名字,出生日期,加入公司的年份,那个部门(用ring0---ring9表示10个部门) ,工资标准等(多多不限)
    要求有对(假如有员工改名, 可以实现改名, 尽管使用中不常见, 但主要是为了实现面向对象思想)(更改工资标准)(开除员工和增加员工)(通过工龄即加入公司的时间来对员工进行排序, 同一年的可随便排)(通过部门的对员工排序, 个部门的集中在一起显示,譬如ring0的排了下了跟着就是全是ring1部门的)
    请兄弟们快点回帖, 把源代码和程序发给我, 搞定后就给200分!!!
    这是我期末考试的题目, 兄弟们要快快快!!
     我的email :  [email protected]
      

  15.   

     如果不用虚拟目录?难道用将数据在局域网上共享吗?那恐怕更不安全了!!
    为什么不用虚拟路径,在Client端通过IE访问该文件时加上密码和权限呢??
      

  16.   

    因为我想Client端通过我的程序的界面来访问该文件,而不是直接访问。
      

  17.   

    我认为:用虚拟路径,在Client端通过IE访问该文件时加上密码和权限,也是通过您的程序。应该是可以。变通一下吧。
      

  18.   

    IIS服务器用NT用户验证,然后设置相应的权限。
    或者像Hotmail那样自己实现用户验证的机制。
      

  19.   

    upup
    我不能再up了
    这是最后一次
    真希望我能够在多up几次
    可是系统不让了
    真遗憾
      

  20.   

    谢谢!我提最后一个问题,如果我能去掉IE窗口的标题(TITLE),别人不就看不到我的虚拟路径了吗?是不是这样?那怎样去掉IE窗口的标题,但最好能保留工具条?