Skip to content

Commit 10ad12b

Browse files
committed
gif image
1 parent 33d3b52 commit 10ad12b

File tree

8 files changed

+6
-19
lines changed

8 files changed

+6
-19
lines changed

ConvertEquations/ConvertEquations/Program.cs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,12 @@ class Program
3131
static void Main(string[] args)
3232
{
3333
Program program = new Program();
34-
string filepath = System.Configuration.ConfigurationManager.AppSettings["filepath"];
3534
string savepath = System.Configuration.ConfigurationManager.AppSettings["savepath"];
3635
string filename = System.Configuration.ConfigurationManager.AppSettings["filename"];
37-
program.MathML2MathTypeWord(program, new ConvertEquation(),savepath, filepath, filename);
36+
program.MathML2MathTypeWord(program, new ConvertEquation(),savepath, filename);
3837
}
3938

40-
public string MathML2MathTypeWord(Program p, ConvertEquation ce, string savepath, string filepath, string filename)
39+
public string MathML2MathTypeWord(Program p, ConvertEquation ce, string savepath, string filename)
4140
{
4241
Utils.killAllProcess("winword.exe");
4342
Utils.killAllProcess("mathtype.exe");
@@ -128,16 +127,8 @@ public string MathML2MathTypeWord(Program p, ConvertEquation ce, string savepath
128127
{
129128
object SaveWithDocument = true;
130129
anchor = newdoc.Application.Selection.Range;
131-
newapp.Selection.Move();
132-
if (matchString.Contains("teacher"))
133-
{
134-
webClient.DownloadFile(matchString, @"c:\\images\\test.png");
135-
newdoc.Application.ActiveDocument.InlineShapes.AddPicture(@"c:\\images\\test.png", true, true, ref anchor);
136-
}
137-
else
138-
{
139-
newdoc.Application.ActiveDocument.InlineShapes.AddPicture(matchString, true, true, ref anchor);
140-
}
130+
webClient.DownloadFile(matchString, @"c:\\images\\test.png");
131+
newdoc.Application.ActiveDocument.InlineShapes.AddPicture(@"c:\\images\\test.png", true, true, ref anchor);
141132
newapp.Selection.Move();
142133
Console.WriteLine("插入图片完成");
143134
}

ConvertEquations/ConvertEquations/app.config

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
55
</startup>
66
<appSettings>
7-
<add key="filepath" value="E:\github\MathML2MathTypeEquation\ConvertEquations\ConvertEquations\Data\"/>
8-
97
<add key="savepath" value="c:\\"/>
10-
<!--<add key="filename" value="热搜化学-500.xls"/>-->
8+
<!--<add key="filename" value="热搜化学-500.xls"/>-->
119
<!--<add key="filename" value="热搜__物理__500-5.xls"/>-->
1210
<!--<add key="filename" value="热搜数学-1000.xls"/>-->
1311
<!--<add key="filename" value="热搜数学-1000-2.xls"/>-->
Binary file not shown.

ConvertEquations/ConvertEquations/bin/Debug/ConvertEquations.exe.config

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
55
</startup>
66
<appSettings>
7-
<add key="filepath" value="E:\github\MathML2MathTypeEquation\ConvertEquations\ConvertEquations\Data\"/>
8-
97
<add key="savepath" value="c:\\"/>
10-
<!--<add key="filename" value="热搜化学-500.xls"/>-->
8+
<!--<add key="filename" value="热搜化学-500.xls"/>-->
119
<!--<add key="filename" value="热搜__物理__500-5.xls"/>-->
1210
<!--<add key="filename" value="热搜数学-1000.xls"/>-->
1311
<!--<add key="filename" value="热搜数学-1000-2.xls"/>-->
Binary file not shown.
Binary file not shown.
Binary file not shown.

doc/effect.gif

-3.12 MB
Loading

0 commit comments

Comments
 (0)