96 lines
3.8 KiB
C#
96 lines
3.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using CommonLib.data;
|
|
using Sashulin;
|
|
using CommonLib;
|
|
using DevExpress.XtraEditors;
|
|
using Lskj.Common;
|
|
using System.Web;
|
|
using Lskj.MyControl;
|
|
|
|
namespace Lskj.PubBrower
|
|
{
|
|
public partial class FrmMain : FormBase
|
|
{
|
|
/// <summary>
|
|
/// url参数
|
|
/// </summary>
|
|
public string UrlParame;
|
|
public string BetweenDLLCoid;
|
|
/// <summary>
|
|
/// 是否是右键下载
|
|
/// </summary>
|
|
/// <param name="args"></param>
|
|
public int downLoadFlag;
|
|
public int RightKeyFlag;
|
|
public int isView;
|
|
public int isPostFlag;
|
|
public string postData;
|
|
|
|
public double PerWidth;//百分比宽
|
|
public double PerHeight;//百分比高
|
|
public bool isCalSize = false;//是否自定义控件高宽
|
|
|
|
public DynamicPubBrowerModel PubBrowerModel;
|
|
public static bool isBatchBrower = false;
|
|
|
|
|
|
public FrmMain()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void FrmMain_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
this.Text = FormText;
|
|
string urlStart = SqlHelper.ExecuteDataTable("select OAUrl from P_systemTab").Rows[0]["OAUrl"] + "";
|
|
//string urlEnd = string.IsNullOrEmpty(TargetDLLCoid) ? DLLCoid : HttpUtility.UrlEncode(PubClass.ReqSqlParam(TargetDLLCoid, OperatorId, OperatorName));
|
|
//string urlBetween = string.IsNullOrEmpty(BetweenDLLCoid) ? null : PubClass.ReqSqlParam(BetweenDLLCoid, OperatorId, OperatorName);
|
|
//string sqlValue = string.Format("select Password from P_employeeTab where employeeid='{0}'", OperatorId);
|
|
//DataTable table = SqlHelper.ExecuteDataTable(sqlValue);
|
|
//if (table != null && table.Rows.Count > 0)
|
|
//{
|
|
// urlEnd = urlEnd.Replace("{password}", table.Rows[0]["Password"] + "");
|
|
//}
|
|
//string url = urlStart + urlBetween + urlEnd;
|
|
|
|
string urlEnd = string.IsNullOrEmpty(this.UrlParame) ? PubClass.ReqSqlParam(this.DLLCoid, OperatorId, OperatorName) : HttpUtility.UrlEncode(this.UrlParame);
|
|
string url = this.BetweenDLLCoid != null && this.BetweenDLLCoid.StartsWith("http") ? this.BetweenDLLCoid + urlEnd : urlEnd.StartsWith("http") ? this.BetweenDLLCoid + urlEnd : urlStart + this.BetweenDLLCoid + urlEnd;
|
|
// NewPage(url, "");
|
|
|
|
|
|
|
|
this.Opacity = 100D;
|
|
previewFrm previewFrm = new previewFrm();
|
|
previewFrm.moduleWebView.PubBrowerModel = this.PubBrowerModel;
|
|
previewFrm.Dock = DockStyle.Fill;
|
|
previewFrm.OnLoad(url, RightKeyFlag);
|
|
this.Controls.Add(previewFrm);
|
|
|
|
}
|
|
//public void NewPage(string newUrl, object req)
|
|
//{
|
|
// CSharpBrowserSettings settings = new CSharpBrowserSettings();
|
|
// //settings.UserAgent = "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 4 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19";
|
|
// settings.CachePath = @"C:\temp\caches";
|
|
// ChromeWebBrowser browser = new ChromeWebBrowser();
|
|
// //browser.BrowserNewWindow += new NewWindowEventHandler(chromeWebBrowser1_BrowserNewWindow);
|
|
// //browser.BrowserTitleChange += new TitleChangeEventHandler(chromeWebBrowser1_BrowserTitleChange);
|
|
// browser.Initialize(settings);
|
|
// browser.Validate();
|
|
// browser.Dock = DockStyle.Fill;
|
|
// //browser.AddPluginDir(PubUtil.AbsolutelyPath + "lib/chromelib");
|
|
// browser.OpenUrl(newUrl);
|
|
|
|
// pl_brower.Controls.Add(browser);
|
|
//}
|
|
}
|
|
}
|