您将使用什么语言在记忆棒上实现自动更新/同步功能?

发布于 2024-08-06 07:06:23 字数 136 浏览 5 评论 0原文

我们需要通过 USB 密钥将文档分发给我们的合作伙伴。我被要求开发一款软件,用于检查服务器上的某些文档是否已更新,并继续同步记忆棒上的文件。

软件本身还需要具有自动更新功能,以便我们将来想要改进它。

你们认为我应该从哪里开始?

We need to distribute documents to our partners on a USB key. I've been asked to develop a piece of software that will check if some documents have been updated on the server and proceed with the synchronization of files on the memory stick.

The software itself will also need to have an auto-update functionality in case we want to improve it in the future.

Where do you guys think I should start?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

铃予 2024-08-13 07:06:23

我假设这是针对 Windows 的。 C# 将是一个很好的选择,除非您无法确定用户是否已经安装了 .Net。否则我会使用 Delphi,它可以轻松创建本机可执行文件。无论您使用什么语言,自动更新功能都会很痛苦,因为正在运行的 EXE 文件无法替换自身。您可以将程序的大部分功能实现为一个单独的 DLL,该 DLL 可以动态更新,但如果您需要更新核心 EXE 本身,您仍然可以解决问题。

I'm assuming this is for Windows. C# would be an excellent choice, unless you can't be sure the user already has .Net installed. Otherwise I'd use Delphi, which can create native executables easily. The auto-update feature will be a pain no matter what language you use, given that a running EXE file can't replace itself. You can implement most of the program's functionality as a separate DLL which can be updated on the fly, but you're still SOL if you need to update the core EXE itself.

花开柳相依 2024-08-13 07:06:23

我建议Python...你可以使其可执行或将其安装在USB本身上(它不大)。一个很大的优点是您可以当场改进它,因为您不需要重新编译。 Python 非常适合此类小任务。

一个很大的优势是平台独立性。

I would suggest Python... you can make its executable or install it on usb itself(its not big). A big advantage you can improve it on the spot as you wont need recompilation. Python is great for such small tasks.

A big advantage is platform independence.

岁吢 2024-08-13 07:06:23

嗯,这显然取决于您要部署的环境以及您个人使用过的环境。我立刻倾向于 C#,因为它有很多文档,并且允许您使用 gui 快速部署 Windows 应用程序。
然而,如果这是一个 Unix 环境,我确信这可以通过一个简单的 shell 脚本来完成。

Well it depends on the environment you are deploying to obviously, and what you personally have worked with. Off the bat I would be leaning towards C#, as there is a lot of documentation and will allow you to rapidly deploy a windows app with gui.
However if this is a Unix environment I sure this could be done in a simple shell script.

旧城烟雨 2024-08-13 07:06:23

无论您最熟悉和最熟练的语言是什么,只要它有一种与服务器通信的简单方法即可。 (如果服务器是网络服务器,那可能不是问题)

Whatever language you're most comfortable in and most skilled at, as long as it has an easy way to communicate with the server. (If the server is a web server, that's probably not an issue)

断爱 2024-08-13 07:06:23

我会研究Microsoft Sync Framework。请参阅“文件同步简介”部分。 “...使用同步框架在桌面和设备之间高效地移动文件。”

我在一个项目中使用了“Sync Services for ADO.Net”(框架的一部分)来同步本地 SQL Express 数据库与主 SQL Server 数据库,它节省了我大量的时间。

I would look into Microsoft Sync Framework. Look at the section "Introduction to File Synchronization." "...use the Sync Framework to efficiently move files between desktops and devices."

I used "Sync Services for ADO.Net" (part of the Framework) for a project to sync a local SQL Express database with the main SQL Server database and it saved me a ton of time.

人海汹涌 2024-08-13 07:06:23

Cygwin 中存在适用于 Windows 的 Rsync - 如果您的服务器支持 ssh,它还支持带有公钥基础设施的 ssh。
这可能是一种非常安全且简单的数据同步方法。

Rsync exists for Windows in Cygwin - it also supports ssh with a public key infrastructure if your server supports ssh.
This could be a very secure and easy way to synchronize data.

开始看清了 2024-08-13 07:06:23

假设这是 Windows,我将从 USB 设备上的这个批处理文件开始:
xcopy /diyc 。 $ServerPath

也许这就足够了?

标志的解释:

/D Copies only those files whose source time is newer than the destination time.
/I If destination does not exist and copying more than one file, assumes that destination must be a directory.
/C Continues copying even if errors occur.
/Y Suppresses prompting to confirm you want to overwrite an existing destination file.

Assuming this is Windows, I would start with this batch file on the USB device:
xcopy /diyc . $ServerPath

Perhaps that is enough?

Explanation on the flags:

/D Copies only those files whose source time is newer than the destination time.
/I If destination does not exist and copying more than one file, assumes that destination must be a directory.
/C Continues copying even if errors occur.
/Y Suppresses prompting to confirm you want to overwrite an existing destination file.
海未深 2024-08-13 07:06:23

一个批处理文件就足够了。我已经用一个简单的解决了类似的问题。另一种选择是 AutoIt 中的脚本,它是一种基本的类似语言,可以创建几乎没有依赖项的小型“编译”程序。您只需将可执行文件复制到 USB 设备并从那里运行它。

A batch file could be enough. I have solved something similar with a simple one. Another option would be a script in AutoIt, its a basic like language which can create small "compiled" programs with almost no dependencies. You just copy the executable to the USB devices and run it from there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文