![](/img/trans.png)
[英]Is there a way to automate MS Office applications without license?
[英]How to register MS office license through pipeline in Azure VM
我计划在 Azure VM 管道方法中使用 MS office 。 下面是我的流程
在 VM 映像(从 Azure VM 创建)中申请 MS office 许可证的任何可能性。 因为,在创建 VM 时,Appdata 的东西(许可证、用户数据)被删除了。
尝试 Appium 选择 UI 元素并通过管道输入许可证密钥:
预期:它应该点击关闭和go到帐户设置以进行许可证注册。
有许多图书馆可供阅读和写作办公。 您不需要激活 MS Office。 下面是我在没有 MS office 的情况下对 VM 的简单测试:
using NPOI.HSSF.UserModel;
using NPOI.POIFS.Crypt.Dsig;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
namespace ConsoleApp1
{
internal class Program
{
static void Main(string[] args)
{
DataTable dt = new DataTable();
HSSFWorkbook hssfworkbook;
using (FileStream file = new FileStream("../../../test.xls", FileMode.Open, FileAccess.Read))
{
hssfworkbook = new HSSFWorkbook(file);
}
HSSFSheet sheet = (HSSFSheet)hssfworkbook.GetSheetAt(0);
System.Collections.IEnumerator rows = sheet.GetRowEnumerator();
HSSFRow headerRow = (HSSFRow)sheet.GetRow(0);
int cellCount = headerRow.LastCellNum;
for (int j = 0; j < cellCount; j++)
{
HSSFCell cell = (HSSFCell)headerRow.GetCell(j);
dt.Columns.Add(cell.ToString());
Console.WriteLine(cell.ToString());
}
for (int i = (sheet.FirstRowNum + 1); i <= sheet.LastRowNum; i++)
{
HSSFRow row = (HSSFRow)sheet.GetRow(i);
DataRow dataRow = dt.NewRow();
for (int j = row.FirstCellNum; j < cellCount; j++)
{
if (row.GetCell(j) != null)
dataRow[j] = row.GetCell(j).ToString();
}
dt.Rows.Add(dataRow);
}
....
我尝试了一些步骤,最后像这样安装了办公室https://learn.microsoft.com/en-us/deployoffice/office2019/deploy
并在创建 VM 映像之前注册密钥。
现在,产品许可证未删除。 我可以看到 MS Office 已获得许可(如果我使用该示例 VM 映像定义再次创建 VM)。
现在,我在启动办公产品(excel、word、outlook)时遇到问题,“接受并启动 excel”、“您的隐私选项”这些 windows 一次又一次地显示。
通过管道使用 WinAppdriver 单击关闭按钮的任何想法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.