自己写的服务调试的时候没有问题,不调试会报1067进程意外终止。在线等大神啊··

zoedaid 2012-12-26 09:41:00
这是我自己写的服务,在服务中加Debugger.Launch();调试可以一直走下去,如果不调试就会出现图片说的问题。求帮助
...全文
126 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
zoedaid 2012-12-26
  • 打赏
  • 举报
回复
还是谢谢·断点调试的时候可以走下去·选择否就出问题·纠结了一早上了··
  • 打赏
  • 举报
回复
那我也没办法了,等别的高手来看下吧
zoedaid 2012-12-26
  • 打赏
  • 举报
回复
加上去的时候调试的·走调试的时候可以·成功建立索引,如果选择否·就会出现进程意外终止1067的错误提示
  • 打赏
  • 举报
回复
楼主,不调试为什么要加 Debugger.Launch(); 这一句?
zoedaid 2012-12-26
  • 打赏
  • 举报
回复
下面还有一个timer控件的我就不贴了····
zoedaid 2012-12-26
  • 打赏
  • 举报
回复
/// <summary> /// 搜索 /// </summary> /// <param name="indexpath"></param> private void CreateIndex(string indexpath,string TableNames) { try { //索引路径 IndexWriter indexwrite; indexwrite = new IndexWriter(indexpath, new PanGuAnalyzer(), true); //indexwrite = new IndexWriter(indexpath, new WhitespaceAnalyzer(), true); Document dm = new Document(); string sql = "select * from "+TableNames; DataSet ds = DBclass.Query(sql); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { Document Doc = new Document(); //公司名称CORPORATION_CNAME Doc.Add(new Field("CORPORATION_CNAME", ds.Tables[0].Rows[i]["CORPORATION_CNAME"].ToString(), Field.Store.YES, Field.Index.TOKENIZED)); //公司地址ADDRESS Doc.Add(new Field("ADDRESS", ds.Tables[0].Rows[i]["ADDRESS"].ToString(), Field.Store.YES, Field.Index.TOKENIZED)); //法人代表LEGAL_PERSON Doc.Add(new Field("LEGAL_PERSON", ds.Tables[0].Rows[i]["LEGAL_PERSON"].ToString(), Field.Store.YES, Field.Index.UN_TOKENIZED)); //法人电话LEGAL_PERSON_TEL Doc.Add(new Field("LEGAL_PERSON_TEL", ds.Tables[0].Rows[i]["LEGAL_PERSON_TEL"].ToString(), Field.Store.YES, Field.Index.UN_TOKENIZED)); //联系人LINKMAN Doc.Add(new Field("LINKMAN", ds.Tables[0].Rows[i]["LINKMAN"].ToString(), Field.Store.YES, Field.Index.UN_TOKENIZED)); //联系人电话TEL Doc.Add(new Field("TEL", ds.Tables[0].Rows[i]["TEL"].ToString(), Field.Store.YES, Field.Index.UN_TOKENIZED)); //联系人手机MOBILE_TEL Doc.Add(new Field("MOBILE_TEL", ds.Tables[0].Rows[i]["MOBILE_TEL"].ToString(), Field.Store.YES, Field.Index.UN_TOKENIZED)); //主营行业INDUSTRY Doc.Add(new Field("INDUSTRY", ds.Tables[0].Rows[i]["INDUSTRY"].ToString(), Field.Store.YES, Field.Index.UN_TOKENIZED)); //成立时间BEGIN_TIME Doc.Add(new Field("BEGIN_TIME", ds.Tables[0].Rows[i]["BEGIN_TIME"].ToString(), Field.Store.YES, Field.Index.UN_TOKENIZED)); //省PROVINCE_CNAME Doc.Add(new Field("PROVINCE_CNAME", ds.Tables[0].Rows[i]["PROVINCE_CNAME"].ToString(), Field.Store.YES, Field.Index.UN_TOKENIZED)); //市CITY_CNAME Doc.Add(new Field("CITY_CNAME", ds.Tables[0].Rows[i]["CITY_CNAME"].ToString(), Field.Store.YES, Field.Index.UN_TOKENIZED)); indexwrite.AddDocument(Doc); } indexwrite.Optimize(); indexwrite.Close(); } catch { throw; } }
zoedaid 2012-12-26
  • 打赏
  • 举报
回复
protected override void OnStart(string[] args) { // TODO: 在此处添加代码以启动服务。 Debugger.Launch(); try { //Thread. //索引目录 indexpath = @"D:\ProviceIndex\Win_Ah"; indexpath_bj = @"D:\ProviceIndex\Win_Bj"; indexpath_cq = @"D:\ProviceIndex\Win_Cq"; indexpath_fj = @"D:\ProviceIndex\Win_Fj"; indexpath_gd = @"D:\ProviceIndex\Win_Gd"; indexpath_gs = @"D:\ProviceIndex\Win_Gs"; indexpath_gx = @"D:\ProviceIndex\Win_Gx"; indexpath_gz = @"D:\ProviceIndex\Win_Gz"; indexpath_hebei = @"D:\ProviceIndex\Win_Hebei"; indexpath_henan = @"D:\ProviceIndex\Win_Henan"; indexpath_hlj = @"D:\ProviceIndex\Win_Hlj"; indexpath_hubei = @"D:\ProviceIndex\Win_Hubei"; indexpath_hunan = @"D:\ProviceIndex\Win_Hunan"; indexpath_jl = @"D:\ProviceIndex\Win_Jl"; indexpath_js = @"D:\ProviceIndex\Win_Js"; indexpath_jx = @"D:\ProviceIndex\Win_Jx"; indexpath_ln = @"D:\ProviceIndex\Win_Ln"; indexpath_nmg = @"D:\ProviceIndex\Win_Nmg"; indexpath_nx = @"D:\ProviceIndex\Win_Nx"; indexpath_qh = @"D:\ProviceIndex\Win_Qh"; indexpath_sc = @"D:\ProviceIndex\Win_Sc"; indexpath_sd = @"D:\ProviceIndex\Win_Sd"; indexpath_sh=@"D:\ProviceIndex\Win_Sh"; indexpath_sx = @"D:\ProviceIndex\Win_Sx"; indexpath_sx2 = @"D:\ProviceIndex\Win_Sx2"; indexpath_tj = @"D:\ProviceIndex\Win_Tj"; indexpath_xj = @"D:\ProviceIndex\Win_Xj"; indexpath_xz = @"D:\ProviceIndex\Win_Xz"; indexpath_yn = @"D:\ProviceIndex\Win_Yn"; indexpath_zj = @"D:\ProviceIndex\Win_Zj"; //数据库表名 TableName = "win_corp_ah"; TableNamebj = "win_corp_bj"; TableNamecq = "win_corp_cq"; TableNamefj = "win_corp_fj"; TableNamegd = "win_corp_gd"; TableNamegs = "win_corp_gs"; TableNamegx = "win_corp_gx"; TableNamegz = "win_corp_gz"; TableNamehebei = "win_corp_hebei"; TableNamehenan = "win_corp_henan"; TableNamehlj = "win_corp_hlj"; TableNamehubei = "win_corp_hubei"; TableNamehunan = "win_corp_hunan"; TableNamejn = "win_corp_jn"; TableNamejs = "win_corp_js"; TableNamejx = "win_corp_jx"; TableNameln = "win_corp_ln"; TableNamenmg = "win_corp_nmg"; TableNamenx = "win_corp_nx"; TableNameqh = "win_corp_qh"; TableNamesc = "win_corp_sc"; TableNamesd = "win_corp_sd"; TableNamesh = "win_corp_sh"; TableNamesx = "win_corp_sx"; TableNamesx2 = "win_corp_sx2"; TableNametj = "win_corp_tj"; TableNamexj = "win_corp_xj"; TableNamexz = "win_corp_xz"; TableNameyn = "win_corp_yn"; TableNamezj = "win_corp_zj"; //索引对象 new System.Threading.Tasks.Task(() => CreateIndex(indexpath,TableName)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_bj, TableNamebj)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_cq, TableNamecq)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_fj, TableNamefj)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_gd, TableNamegd)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_gs, TableNamegs)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_gx, TableNamegx)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_gz, TableNamegz)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_hebei, TableNamehebei)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_henan, TableNamehenan)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_hlj, TableNamehlj)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_hubei, TableNamehubei)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_hunan, TableNamehunan)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_jl, TableNamejn)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_js, TableNamejs)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_jx, TableNamejx)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_ln, TableNameln)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_nmg, TableNamenmg)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_nx, TableNamenx)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_qh, TableNameqh)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_sc, TableNamesc)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_sd, TableNamesd)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_sh, TableNamesh)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_sx, TableNamesx)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_sx2, TableNamesx2)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_tj, TableNametj)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_xj, TableNamexj)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_xz, TableNamexz)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_yn, TableNameyn)).Start(); new System.Threading.Tasks.Task(() => CreateIndex(indexpath_zj, TableNamezj)).Start(); // CreateIndex(indexpath); // CreateIndex(indexpath1); System.Timers.Timer timer = new System.Timers.Timer(3600000); timer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_TimesUp); timer.Start(); } catch { throw; } }
  • 打赏
  • 举报
回复
把服务的c#代码贴过来看下
zoedaid 2012-12-26
  • 打赏
  • 举报
回复
求大神出现·小弟先谢谢了···在线等候

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧