没有合适的资源?快使用搜索试试~ 我知道了~
从MS Project 导入内容 (C#)
3星 · 超过75%的资源 需积分: 14 34 下载量 11 浏览量
2008-12-20
15:35:38
上传
评论
收藏 25KB DOC 举报
温馨提示
试读
2页
用C# 操控MS Project,可以从其中导出任何你想要的信息,最近再做个研究,小有收获,贴出来分享一下!
资源推荐
资源详情
资源评论
public class ImportTasks
{
ApplicationClass projectApp = new ApplicationClass();
private object oMissing = System.Re#ection.Missing.Value;
private object objFalse = false;
private Hashtable taskArray = new Hashtable();
private Hashtable itemArray;
private Hashtable taskReturn = new Hashtable();
public bool ImportMppFile(string srcFile)
{
//判断文件是否存在
if (!File.Exists(srcFile))
{
MessageState.SetMessageBox(MSG._FILE_NOT_EXIST, MessageType.Alert);
return false;
}
//检查问价是否是MS Project 文件
string ext = Path.GetExtension(srcFile).ToLower();
if (ext.IndexOf("mpp") == -1)
{
MessageState.SetMessageBox(MSG._FILE_NOT_FIT, MessageType.Alert);
return false;
}
try
{
projectApp.FileOpen(srcFile, objFalse, PjMergeType.pjDoNotMerge, oMissing,
oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing, oMissing,
PjPoolOpen.pjDoNotOpenPool, oMissing, oMissing, oMissing, oMissing);
}
catch
{
MessageState.SetMessageBox(MSG._FILE_NOT_FIT, MessageType.Alert);
return false;
}
int j = 0;
foreach (Project pro in projectApp.Projects)
{
foreach (Task ts in pro.Tasks)
{
itemArray = new Hashtable();
资源评论
- yrmelody2013-07-23可以学习,不过不完整
- ltginprise2012-07-04学习中,测试时发现.COM组件不稳定。
- 你大家好2013-05-17测试时发现.COM组件不稳定。
- bigwindow2012-11-18不好用,时好时坏
- bgy0072013-05-21测试时,发现有不稳定现象,建议楼主再进行改进!
appllon
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功