加载中
加载中
表情图片
评为精选
鼓励
加载中...
分享
加载中...
文件下载
加载中...
修改排序
加载中...
英文文档阅读助手,英语学习助手
张静茹2015/07/01软件综合 IP:山东
1.gif
1.gif

attachment icon 学英语_划词翻译.rar 6.50KB RAR 25次下载

[修改于 10年2个月前 - 2015/07/01 13:08:16]

来自:计算机科学 / 软件综合
9
新版本公告
~~空空如也
张静茹 作者
10年2个月前 IP:山东
776196
这个需要.net3.5,上面的需要.net4.5
attachment icon 学英语_划词翻译.rar 6.46KB RAR 40次下载
引用
评论
加载评论中,请稍候...
200字以内,仅用于支线交流,主线讨论请采用回复功能。
折叠评论
张静茹作者
10年2个月前 IP:山东
776440
Other
public partial class Form2 : Form     {         public Form2()         {             InitializeComponent();         }         [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "SetForegroundWindow")]         public static extern bool SetForegroundWindow(IntPtr hWnd);//设置此窗体为活动窗体         private void Form2_Load(object sender, EventArgs e)         {             webBrowser.ScriptErrorsSuppressed = true;         }         IntPtr _form1;         public void Navigate(string urlString, IntPtr __form1)         {             _form1 = __form1;             webBrowser.Navigate(urlString);              }         private void webBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)         {             SetForegroundWindow(_form1);         }              private void Form2_Activated(object sender, EventArgs e)         {             SetForegroundWindow(_form1);         }     }
引用 acmilan:
源码能否一发?



Other
public partial class Form1 : Form     {         public Form1()         {             InitializeComponent();         }         //调用API         [System.Runtime.InteropServices.DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto, ExactSpelling = true)]         public static extern IntPtr GetForegroundWindow(); //获得本窗体的句柄         [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "SetForegroundWindow")]         public static extern bool SetForegroundWindow(IntPtr hWnd);//设置此窗体为活动窗体         //定义变量,句柄类型         public IntPtr han;         private void textBox1_MouseDown(object sender, MouseEventArgs e)         {             //Text = string.Format("当前选中位置 {0} 当前选中字符长度 {1} 当前选中文本 {2}", textBoxSou.SelectionStart, textBoxSou.SelectionLength, textBoxSou.SelectedText);                       string poram  = WordStartEnd(textBoxSou.Text,textBoxSou.SelectionStart);             if (string.IsNullOrEmpty(poram))             {                 return;             }                  IntPtr _form1 = GetForegroundWindow();             F2.Navigate(string.Format("http://www.bing.com/dict/search?q={0}&go=%E6%8F%90%E4%BA%A4&qs=bs&form=CM", poram), _form1);                              Text = _form1.ToString("X");                  //this.Focus();             //SetForegroundWindow(_form1);             //MessageBox.Show(textBoxSou.Text.Substring(start, end - start));         }         /// <summary>         /// 寻找单词起点与终点         /// </summary>         /// <param name="Text">         /// <param name="SelectionStart">         /// <param name="start">         /// <param name="end">         private string WordStartEnd(string Text, int SelectionStart)         {             int start = 0,end = 0;             for (int i = SelectionStart; i < Text.Length; i++) //确定结束点             {                 if (!char.IsLetter(Text))                 {                     end = i;                     break;                 }             }             if (end == 0) end = Text.Length;                  for (int i = SelectionStart - 1; i >= 0; i--) //确定起始点             {                 if (!char.IsLetter(Text))                 {                     start = i + 1;                     break;                 }             }                  string temp = Text.Substring(start, end - start);             if (!Regex.IsMatch(temp,"[a-z]"))             {                 return temp;             }                  for (int i = SelectionStart; i < end; i++) //往终点寻找大写             {                 if(char.IsUpper(Text))                 {                     end = i;                     break;                 }             }             for (int i = SelectionStart-1; i >= start; i--)//往起点寻找大写             {                 if (char.IsUpper(Text))                 {                     start = i;                     break;                 }             }                  return Text.Substring(start, end - start);         }              private void 设置ToolStripMenuItem_Click(object sender, EventArgs e)         {             MessageBox.Show("asd");         }              private void 字体ToolStripMenuItem_Click(object sender, EventArgs e)         {             fontDialog字体.Font = textBoxSou.Font;             fontDialog字体.Color = textBoxSou.ForeColor;                  fontDialog字体.ShowColor = true;             fontDialog字体.ShowDialog();             textBoxSou.Font = fontDialog字体.Font;             textBoxSou.ForeColor = fontDialog字体.Color;         }              private void 背景颜色ToolStripMenuItem_Click(object sender, EventArgs e)         {             colorDialog颜色.ShowDialog();             textBoxSou.BackColor = colorDialog颜色.Color;         }              private void textBoxSou_KeyDown(object sender, KeyEventArgs e)         {             TextBox tbtem = (TextBox)sender;             if (e.Control && e.KeyCode == Keys.A)             {                 tbtem.SelectionStart = 0;                 tbtem.SelectionLength = tbtem.Text.Length;                 e.Handled = true;             }         }              private void 测试ToolStripMenuItem_Click(object sender, EventArgs e)         {             //webBrowser.DocumentText = Http.Get("http://www.bing.com/dict/search?q=" + "browser" + "&go=%E6%8F%90%E4%BA%A4&qs=bs&form=CM", "");             IntPtr ip = GetForegroundWindow();             int i = ip.ToInt32();             Text = i.ToString("X");                  SetForegroundWindow(new IntPtr(0x00391422));              }         Form2 F2 ;         private void Form1_Load(object sender, EventArgs e)         {             F2 = new Form2();             F2.Show();         }     }
引用
评论
加载评论中,请稍候...
200字以内,仅用于支线交流,主线讨论请采用回复功能。
折叠评论
张静茹作者
10年2个月前 修改于 10年2个月前 IP:山东
776634
更新V1.1:
加入点击朗读,点击一次朗读两遍
优化逻辑,重复点击一个单词,只重复朗读,不刷新网页
软件关闭之后保存文档,打开后自动载入
修复显示翻译的网页不能获取焦点

点击单词则翻译朗读单词,能分开中间没有空格的单词,如果选中了多个单词或某几个字母,则只翻译选中的部分
attachment icon 学英语_划词翻译.rar 7.58KB RAR 17次下载
引用
评论
加载评论中,请稍候...
200字以内,仅用于支线交流,主线讨论请采用回复功能。
折叠评论
张静茹作者
10年0个月前 IP:北京
786749
最新版
attachment icon 学英语_划词翻译.rar 25.15KB RAR 25次下载

网页和文档改成一个窗口 F1阅读快捷键

RLC5NKZGP)64OZHZ$A$ZKHA.png
引用
评论
加载评论中,请稍候...
200字以内,仅用于支线交流,主线讨论请采用回复功能。
折叠评论
张静茹作者
9年11个月前 IP:山东
791529
1.gif
新版本
attachment icon 学英语_划词翻译.rar 27.72KB RAR 16次下载
引用
评论
加载评论中,请稍候...
200字以内,仅用于支线交流,主线讨论请采用回复功能。
折叠评论

想参与大家的讨论?现在就 登录 或者 注册

所属专业
所属分类
上级专业
同级专业
张静茹
进士 学者 机友 笔友
文章
139
回复
1869
学术分
1
2010/12/30注册,11天11时前活动
暂无简介
主体类型:个人
所属领域:无
认证方式:手机号
IP归属地:未同步
插入公式
评论控制
加载中...
文号:{{pid}}
投诉或举报
加载中...
{{tip}}
请选择违规类型:
{{reason.type}}

空空如也

笔记
{{note.content}}
{{n.user.username}}
{{fromNow(n.toc)}} {{n.status === noteStatus.disabled ? "已屏蔽" : ""}} {{n.status === noteStatus.unknown ? "正在审核" : ""}} {{n.status === noteStatus.deleted ? '已删除' : ''}}
  • 编辑
  • 删除
  • {{n.status === 'disabled' ? "解除屏蔽" : "屏蔽" }}
我也是有底线的