从C上的文件夹中打开某人的CV文件: [英] open a CV file of a perticular person from folder on C:

查看:74
本文介绍了从C上的文件夹中打开某人的CV文件:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在.net的Windows窗体应用程序中,我想从C:上的文件夹中打开某人的CV文件.为了做到这一点,我在gridview上保留了一个链接按钮,但是我没有得到如何为该按钮编写代码的人可以帮我吗
感谢和问候
来自
Abhijit

In windows form application in .net I want to open a CV file of a perticular person from folder on C:. in order to do that i kept a link button on gridview but i''am not getting how to write the code for that button can any one help me for that
thanks and regards
from
Abhijit

推荐答案

如何编写取决于您打开CV文件"的含义.

例如,如果您将其作为Word文档使用,则只需使用Process.Start:
How you write it depends on what you mean by "open a CV file"

If you have it as a Word document for example, then you would just use Process.Start:
private void butOpenCV_Click(object sender, EventArgs e)
    {
    string cvToOpen = @"D:\Temp\ThisBlokesCV.docx";
    Process.Start(cvToOpen);
    }


如果您想将其打开到您的应用程序中,那么我们将需要更多信息.


If you want to open it into your application, then we would need more information.


私有无效dataGridView1_CellContentClick(object sender,DataGridViewCellEventArgs e)
{
DataGridViewRowCollection行= dataGridView1.Rows;

int selectedvalue = e.RowIndex;
字符串路径=";
for(int j = 0; j< rows.Count; j ++)
{
if(selectedvalue ==行[j] .Index)
{
for(int k = 0; k< rows [j] .Cells.Count; k ++)
{
DataGridViewColumn名称=行[j].单元格[k] .OwningColumn;
如果(name.Name.Equals("CV_Destination"))
{
路径=行[j].单元格[k] .Value.ToString();
}
}
}
}
//StreamReader objreader = new StreamReader(dataGridView1.Rows);
处理myProc;
myProc = Process.Start(路径);

}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
DataGridViewRowCollection rows = dataGridView1.Rows;

int selectedvalue = e.RowIndex;
string path = "";
for (int j = 0; j < rows.Count; j++)
{
if (selectedvalue == rows[j].Index)
{
for (int k = 0; k < rows[j].Cells.Count; k++)
{
DataGridViewColumn name = rows[j].Cells[k].OwningColumn;
if (name.Name.Equals("CV_Destination"))
{
path = rows[j].Cells[k].Value.ToString();
}
}
}
}
//StreamReader objreader = new StreamReader(dataGridView1.Rows);
Process myProc;
myProc = Process.Start(path);

}


这篇关于从C上的文件夹中打开某人的CV文件:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆