英文文档阅读助手,英语学习助手
张静茹2015/07/01软件综合 IP:山东
1.gif
1.gif

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

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

来自:计算机科学 / 软件综合
9
已屏蔽 原因:{{ notice.reason }}已屏蔽
{{notice.noticeContent}}
~~空空如也
张静茹 作者
8年11个月前 IP:山东
776196
这个需要.net3.5,上面的需要.net4.5
attachment icon 学英语_划词翻译.rar 6.46KB RAR 39次下载
引用
评论
加载评论中,请稍候...
200字以内,仅用于支线交流,主线讨论请采用回复功能。
折叠评论
无语·回忆
8年11个月前 IP:山东
776327
不错,挺好用的,翻译英文方便多了
引用
评论
加载评论中,请稍候...
200字以内,仅用于支线交流,主线讨论请采用回复功能。
折叠评论
acmilan
8年11个月前 IP:四川
776352
源码能否一发?
引用
评论
加载评论中,请稍候...
200字以内,仅用于支线交流,主线讨论请采用回复功能。
折叠评论
acmilan
8年11个月前 IP:四川
776385
然而我也做了一个类似的[s:20]
捕获.png
引用
评论
加载评论中,请稍候...
200字以内,仅用于支线交流,主线讨论请采用回复功能。
折叠评论
张静茹作者
8年11个月前 IP:山东
776440
<code class="lang-c">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);
        }
    }</code>
引用 acmilan:
源码能否一发?



<code class="lang-c">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<i>))
                {
                    end = i;
                    break;
                }
            }
            if (end == 0) end = Text.Length;
    
            for (int i = SelectionStart - 1; i >= 0; i--) //确定起始点
            {
                if (!char.IsLetter(Text<i>))
                {
                    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<i>))
                {
                    end = i;
                    break;
                }
            }
            for (int i = SelectionStart-1; i >= start; i--)//往起点寻找大写
            {
                if (char.IsUpper(Text<i>))
                {
                    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();
        }
    }</i></i></i></i></code>
引用
评论
加载评论中,请稍候...
200字以内,仅用于支线交流,主线讨论请采用回复功能。
折叠评论
张静茹作者
8年11个月前 修改于 8年11个月前 IP:山东
776634
更新V1.1:
加入点击朗读,点击一次朗读两遍
优化逻辑,重复点击一个单词,只重复朗读,不刷新网页
软件关闭之后保存文档,打开后自动载入
修复显示翻译的网页不能获取焦点

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

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

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

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

所属专业
所属分类
上级专业
同级专业
张静茹
进士 学者 机友 笔友
文章
138
回复
1857
学术分
1
2010/12/30注册,2天22时前活动
暂无简介
主体类型:个人
所属领域:无
认证方式:手机号
IP归属地:未同步
文件下载
加载中...
{{errorInfo}}
{{downloadWarning}}
你在 {{downloadTime}} 下载过当前文件。
文件名称:{{resource.defaultFile.name}}
下载次数:{{resource.hits}}
上传用户:{{uploader.username}}
所需积分:{{costScores}},{{holdScores}}下载当前附件免费{{description}}
积分不足,去充值
文件已丢失

当前账号的附件下载数量限制如下:
时段 个数
{{f.startingTime}}点 - {{f.endTime}}点 {{f.fileCount}}
视频暂不能访问,请登录试试
仅供内部学术交流或培训使用,请先保存到本地。本内容不代表科创观点,未经原作者同意,请勿转载。
音频暂不能访问,请登录试试
支持的图片格式:jpg, jpeg, png
插入公式
评论控制
加载中...
文号:{{pid}}
投诉或举报
加载中...
{{tip}}
请选择违规类型:
{{reason.type}}

空空如也

加载中...
详情
详情
推送到专栏从专栏移除
设为匿名取消匿名
查看作者
回复
只看作者
加入收藏取消收藏
收藏
取消收藏
折叠回复
置顶取消置顶
评学术分
鼓励
设为精选取消精选
管理提醒
编辑
通过审核
评论控制
退修或删除
历史版本
违规记录
投诉或举报
加入黑名单移除黑名单
查看IP
{{format('YYYY/MM/DD HH:mm:ss', toc)}}