我一直在使用以下代码来写入word文件但不能存储word文件.有没有办法用C#存储word文件?
object oMissing = System.Reflection.Missing.Value;
object oEndOfDoc = "\\endofdoc"; /* \endofdoc is a predefined bookmark */
//Start Word and create a new document.
Microsoft.Office.Interop.Word._Application oWord = new Microsoft.Office.Interop.Word.Application();
Microsoft.Office.Interop.Word._Document oDoc = new Microsoft.Office.Interop.Word.Document();
oWord.Visible = true;
oDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
//Insert a paragraph at the beginning of the document.
Microsoft.Office.Interop.Word.Paragraph oPara1;
oPara1 = oDoc.Content.Paragraphs.Add(ref oMissing);
oPara1.Range.Text = "Heading 1";
oPara1.Range.Font.Bold = 1;
oPara1.Format.SpaceAfter = 24; //24 pt spacing after paragraph.
Run Code Online (Sandbox Code Playgroud) 这是我的字符串:
1-1 This is my first string. 1-2 This is my second string. 1-3 This is my third string.
Run Code Online (Sandbox Code Playgroud)
我怎么能像C#一样打破;
result[0] = This is my first string.
result[1] = This is my second string.
result[2] = This is my third string.
Run Code Online (Sandbox Code Playgroud) 我想使用“浏览”和“上传”按钮
我有使用以下代码的文本框:
的CSS
.uploadpathdiv
{
margin:0;
height:44px;
width:464px;
background:url('images/img-upload.png') no-repeat bottom;
}
.uploadpath
{
background:none;
border:none;
width:400px;
height:40px;
margin:0;
padding: 2px 7px 0px 7px;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:11px;
}
Run Code Online (Sandbox Code Playgroud)
的HTML
<div class="uploadpathdiv">
<input class="uploadpath" name="path" type="text" />
</div>
<img src="/themes/scaccarium/images/button-upload.png" />
<img src="/themes/scaccarium/images/button-browse.png" />
Run Code Online (Sandbox Code Playgroud)
图像代码既用于“浏览”按钮,又用于“上传”按钮。
请帮助我更正上面的代码,以便当我按下浏览按钮时,如您在使用时所看到的那样,得到“文件选择选项” <input type = "file" name="browse">。其次,文件的路径必须显示在上面的文本框中。
第三,当我按下上传按钮时,文件应该被上传
我有像下面的HTML代码
<input type = "textarea" id="sentence1"> Here is my sentence </textarea>
<input type="hidden" name="sentence2" value="This is another sentence">
Run Code Online (Sandbox Code Playgroud)
PHP:
$_POST['sentence1'] //shows nothing
$_POST['sentence2'] // works fine
Run Code Online (Sandbox Code Playgroud)
我想获得sentence1的值也是但我有这样一个分散的代码,对于textarea我不能将"id"改为"name",否则我将不得不在不同的文件中进行很多更改.
我必须将这两个句子都转移到PHP,所以请帮助我,我该怎么做?
我有以下代码,我想在控制台上打印回文.请让我知道if条件中应该包含什么内容,以便它可以在0到10000之间打印所有回文.
回文是161,1221,4554等....
Java代码:
int palindrome[];
palindrome = new int[10000];
for (int count = 0; count < palindrome.length; count++ ){
palindrome[count] = 0;
if(){
System.out.println(count);
}
}
Run Code Online (Sandbox Code Playgroud) 如何在PHP中访问以下数组:
$Record = Array ( [0] => 1 [1] => 1 [2] => 1);
Run Code Online (Sandbox Code Playgroud)
我试过了
echo $Record[0];
Run Code Online (Sandbox Code Playgroud)
但没有运气:(