我写了一个webpart和一个exe程序,用同样的代码用同样的代码去调用另一个exe程序“Importer”:System.Diagnostics.Process pImporter = new System.Diagnostics.Process(); pImporter.StartInfo.FileName=@"C:\Program Files\Importer"; //调用“Importer”
strImporter=@"-folder e:\SPS -root http://test/site/net/viewlsts.aspx?BaseType=0 - CreateListTemplates False -OKToImportToExistingSite False - OKToImportToExistingLibrary True -ImportSecurity False -ImportDesign False - reportLevel Information"; //参数
pImporter.StartInfo.Arguments=strImporter;
pImporter.Start();
if(pImporter.HasExited)
pImporter.Kill(); 结果webpart运行正常,而exe程序运行结果不正确。我怀疑是参数strImporter里面有网址,或者某些特殊字符,导致运行不成功的。请教哪位高手能看出问题?谢谢。
strImporter=@"-folder e:\SPS -root http://test/site/net/viewlsts.aspx?BaseType=0 - CreateListTemplates False -OKToImportToExistingSite False - OKToImportToExistingLibrary True -ImportSecurity False -ImportDesign False - reportLevel Information"; //参数
pImporter.StartInfo.Arguments=strImporter;
pImporter.Start();
if(pImporter.HasExited)
pImporter.Kill(); 结果webpart运行正常,而exe程序运行结果不正确。我怀疑是参数strImporter里面有网址,或者某些特殊字符,导致运行不成功的。请教哪位高手能看出问题?谢谢。
解决方案 »
- c#编写的ActiveX 在别人电脑上不能显示!!
- 请教一个asp升级.net的问题
- 未将对象的引用设置到对象的实例??
- VS2005到底出来了还是没出来?D版市场卖的都是2003。许多人说出来了。
- access c#定位和打包问题
- DATAGRID控件怎么会这样??请教!
- 北大青鸟考试有点疑问!麻烦朋友们帮看下,谢谢了!否则我下次补考还不会。。
- (高手请进)listviewitem 屏幕的绝对位置 不是相对listview的相对位置
- 如何确定坐标
- 一段用VB写的加密的代码,谁能帮我用C#改写?
- 在C#中如何实现在两个窗体间进行变量传递
- 怎么往数据库里添加数据啊,怎么不对啊,哪位大哥大姐帮帮我
Site creation failed (site=http___test_sites_net_viewlsts.aspx_BaseType_0). Error: Cannot connect to the configuration database.
Could not create the site http___test_sites_net_viewlsts.aspx_BaseType_0 last logger error : "Site creation failed (site=http___test1_sites_net_viewlsts.aspx_BaseType_0). Error: Cannot connect to the configuration database." see log.txt for more details
Added 0 documents
Added 0 list items
All done!
See import06160929.log for more info
如果你怀疑是特殊字符的原因,全改成转义字符串试试
strImporter=@"-folder e:\SPS -root http://test/site/net/viewlsts.aspx?…………加了@号在前面。主要是我看到日志的第二行:Site creation failed (site=http___test_sites_net_viewlsts.aspx_BaseType_0). 这个site怎么会变成这样了呢?
-------------------------------------------------------
应该是http地址中的特殊符号没有识别出来,转义后再试试
怎么转义?
Fail gracefully: Invalid URI: The format of the URI could not be determined.
Invalid URI: The format of the URI could not be determined.
at System.Uri.Parse()
at System.Uri..ctor(String uriString, Boolean dontEscape)
at System.Uri..ctor(String uriString)
at Microsoft.SharePoint.SPSite.a(String A_0, SPVirtualServer A_1, a A_2, Int32 A_3)
at Microsoft.SharePoint.SPSite..ctor(String strUrl)
at SharePointExtractor.Extractor.Process(DataSet parameters)
Extracted: 0 list items and 0 documentsDone