小编Osc*_*car的帖子

Wix,在 ProgressDlg 中显示自定义状态消息

我正在尝试按照以下答案在默认 wix 的 ProgressDlg 中显示自定义状态消息:

WiX:在 CustomAction 期间动态更改状态文本

到目前为止,我在我的自定义操作中得到了这个代码:

public class CustomActions
    {
        [CustomAction]
        public static ActionResult CustomAction1(Session session)
        {
            Debugger.Launch();
            session.Log("Begin CustomAction1");
            MessageTest(session);
            return ActionResult.Success;
        }


        private static void MessageTest(Session session)
        {
            for (int i = 0; i < 10; i++)
            {
                using (Record r = new Record(0))
                {
                    r.SetString(0, $"Hello worls {i}");
                    session.Message(InstallMessage.ActionData, r);
                }
                Thread.Sleep(1000);
            }
        }
    }
Run Code Online (Sandbox Code Playgroud)

然后,在 Product.wxs 中有以下 xml 片段:

<Binary Id="CuCustomInstallActionsBinary" SourceFile="$(var.ConsoleApplication1_TargetDir)CustomAction1.CA.dll" />
<CustomAction Id="CuCustomActionOnAfterInstall" BinaryKey="CuCustomInstallActionsBinary" DllEntry="CustomAction1" Execute="deferred" HideTarget="no" Return="check" Impersonate="no" />

    <InstallExecuteSequence> …
Run Code Online (Sandbox Code Playgroud)

windows-installer wix wix3.5

2
推荐指数
1
解决办法
1078
查看次数

在java中从XML转换为JSON

XMLSerializer xmlSerializer = new XMLSerializer(); 
        JSON json  = xmlSerializer.read( xmlString );  
        System.out.println( json.toString(2) );


Exception in thread "main" java.lang.NoClassDefFoundError: nu/xom/Serializer
    at src.main.parser.main(parser.java:19)
Caused by: java.lang.ClassNotFoundException: nu.xom.Serializer
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 1 more
Run Code Online (Sandbox Code Playgroud)

虽然我从XML转换到Json我得到了这个错误......?

我怎么能解决这个问题.

谢谢Sankar

java xml json

1
推荐指数
1
解决办法
7141
查看次数

如何使用nodejs/javascript实现地理编码响应?

我是谷歌地图api的新手.我正在尝试实施谷歌地图地理编码API.
Google Developers上的地理编码API

exports.FindByKeyWord = function (req, res, next) {

    var API_KEY = "SOMEDATA";
    var BASE_URL = "https://maps.googleapis.com/maps/api/geocode/json?address=";

    var address = "1600 Amphitheatre Parkway, Mountain View, CA";

    var url = BASE_URL + address + "&key=" + API_KEY;

    var map = new google.maps.Map();
    var geocoder = new google.maps.Geocoder();

    geocoder.geocode(url, function(results, status) {
        if (status === google.maps.GeocoderStatus.OK) {
            map.setCenter(results[0].geometry.location);
            var marker = new google.maps.Marker({
                map: map,
                position: results[0].geometry.location
            });
            res.json(marker);
        } else {
            alert('Geocode was not successful for the following reason: ' …
Run Code Online (Sandbox Code Playgroud)

javascript google-maps-api-3 node.js

0
推荐指数
1
解决办法
2615
查看次数

Transact SQL:ISNULL返回null

我的SQL Server 2017中有以下表格:

CREATE TABLE [dbo].[sync_versions](
    [id] [bigint] IDENTITY(1,1) NOT NULL,
    [id_device_type] [bigint] NOT NULL,
    [version_stamp] [nvarchar](50) NOT NULL,
    [update_date] [datetime2](7) NULL,
 CONSTRAINT [PK_sync_versions] PRIMARY KEY CLUSTERED 
(
    [id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[sync_versions] ADD  DEFAULT (getdate()) FOR [update_date]
GO

ALTER TABLE [dbo].[sync_versions]  WITH CHECK ADD  CONSTRAINT [FK_sync_versions_device_type] FOREIGN KEY([id_device_type])
REFERENCES [dbo].[device_types] ([id])
GO

ALTER TABLE [dbo].[sync_versions] CHECK CONSTRAINT …
Run Code Online (Sandbox Code Playgroud)

t-sql sql-server

0
推荐指数
1
解决办法
103
查看次数