/// <summary> /// 不进行初始化读取数据,该方法用于同一个会话进行多个操作,在调用该方法之前必须调用initHttp /// </summary> /// <param name="title"></param> /// <returns></returns> public WosData SearchNoInit(string title, int random) { if (random > 0) { int slper = (int)(dom.NextDouble() * random * 1000); Thread.Sleep(slper); } if (searchCount == -1) { this.InitHttp(); } searchCount++; if (searchCount > 30) { this.InitHttp(); searchCount = 0; } WosData wosData = new WosData(); try { string[] datas = DownLoad(http, ref result, cookie, title, false); if (datas == null) { return(null); } wosData.setDataArray(datas); } catch (Exception e) { Logs.WriteLog(e.ToString()); throw e; } return(wosData); }
public WosData Search(string title, string year) { WosData wosData = new WosData(); string[] datas = Search(title, year, false); if (datas == null) { return(null); } wosData.setDataArray(datas); return(wosData); }
public WosData Search(string title) { title = title.Replace("'", "\\'").Replace("\"", "\\\""); DataTable dt = DBConnector.MySqlCon.ExecSql("select * from titlematch where title = '" + title + "'"); if (dt.Rows.Count < 1) { return(null); } else { string ut = dt.Rows[0]["UT"].ToString(); DataTable dt1 = DBConnector.MySqlCon.ExecSql("select * from wosdata where UT='" + ut + "'"); object[] datas = dt1.Rows[0].ItemArray; WosData wosData = new WosData(); wosData.setDataArray(datas); return(wosData); } }