Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
onlyoffice_core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
onlyoffice_core
Commits
61712d64
Commit
61712d64
authored
Sep 28, 2016
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
3b0e4df6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
1 deletion
+50
-1
Test/Applications/TestDocsWithChart/TestDocsWithChart/Program.cs
...plications/TestDocsWithChart/TestDocsWithChart/Program.cs
+50
-1
No files found.
Test/Applications/TestDocsWithChart/TestDocsWithChart/Program.cs
View file @
61712d64
...
...
@@ -45,8 +45,57 @@ namespace TestDocsWithChart
{
static
void
Main
(
string
[]
args
)
{
getFilesAlternateContent
();
//getFiles();
convertFiles
();
//convertFiles();
}
static
void
getFilesAlternateContent
()
{
string
sAlternateContent
=
":Choice "
;
string
sDirInput
=
@"\\192.168.3.208\allusers\Files\PPTX"
;
string
sDirOutput
=
@"F:\Files\AlternateContent\pptx"
;
String
[]
allfiles
=
System
.
IO
.
Directory
.
GetFiles
(
sDirInput
,
"*.*"
,
System
.
IO
.
SearchOption
.
AllDirectories
);
for
(
var
i
=
0
;
i
<
allfiles
.
Length
;
++
i
)
{
string
file
=
allfiles
[
i
];
try
{
ZipArchive
zip
=
ZipFile
.
OpenRead
(
file
);
string
sOutputPath
=
Path
.
Combine
(
sDirOutput
,
Path
.
GetFileName
(
file
));
bool
bCopy
=
false
;
string
sRes
=
""
;
foreach
(
ZipArchiveEntry
entry
in
zip
.
Entries
)
{
if
(
entry
.
FullName
.
EndsWith
(
".xml"
,
StringComparison
.
OrdinalIgnoreCase
))
{
using
(
StreamReader
reader
=
new
StreamReader
(
entry
.
Open
(),
Encoding
.
UTF8
))
{
string
sXml
=
reader
.
ReadToEnd
();
int
nIndex
=
-
1
;
while
(-
1
!=
(
nIndex
=
sXml
.
IndexOf
(
sAlternateContent
,
nIndex
+
1
)))
{
if
(!
bCopy
)
{
bCopy
=
true
;
sRes
+=
sOutputPath
;
System
.
IO
.
File
.
Copy
(
file
,
sOutputPath
,
true
);
}
sRes
+=
";"
;
sRes
+=
entry
.
ToString
();
sRes
+=
"-"
;
sRes
+=
sXml
.
Substring
(
nIndex
,
sXml
.
IndexOf
(
">"
,
nIndex
+
1
)
-
nIndex
);
}
}
}
}
Debug
.
WriteLineIf
(
bCopy
,
sRes
);
}
catch
(
Exception
e
)
{
}
}
}
static
void
getFiles
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment