IP 地址“部分”是如何构成的?叫?

发布于 2024-10-15 14:57:57 字数 238 浏览 4 评论 0原文

验证 IP 地址时,每个点分隔“部分”的正确名称是什么。

例如,如果用户输入以下无效 IP:

999.45.34.23

正确的验证错误消息是什么?

是:“第一个 IP 八位字节无效”吗?

参考文献: 维基百科

When validating an IP address, what is the correct name of each dot seperated "part".

For example, if a user inputs the following invalid IP:

999.45.34.23

What is the correct validation error message?

Is it: "The first IP octet is invalid" ?

References: wikipedia

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

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

发布评论

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

评论(3

朕就是辣么酷 2024-10-22 14:57:57

我认为您应该坚持使用技术上正确的术语,即 八位字节

正如其他人所观察到的,缺点是这可能会让典型用户感到困惑,他们可能不知道“八位字节”是什么。不过,使用不同的术语也不是一个好的选择,因为您可能会让那些确实知道八位位组是什么并希望看到在其中使用的正确术语的用户感到困惑和/或失望。适当的背景。

也许最好的妥协是敢于超越典型的“错误:无效输入”样式消息。我将包含一个不正确输入的特定示例,以及错误文本。在这种情况下,您可能会显示用户输入的 IP 地址,其中不正确的八位字节以红色突出显示。

这需要程序员付出相当大的努力,他们不能再调用 MessageBox 函数并保留它。但可用性方面有了巨大的提升。这种方法的优点是,有经验的用户可以简单地阅读文本消息并确切地知道需要修复什么。不了解错误的缺乏经验的用户可以花费更多时间阅读对话框,并且仍然确切地知道需要修复什么。

请考虑以下概念草图:

     更多描述性错误消息,有问题的八位字节以红色突出显示

(显然,当您的应用程序最终决定支持 IPv6 时,您需要进行相应的修改。)

I think you should stick with the technically correct term, which is octet.

The drawback, as others have observed, this has the potential to confuse typical users, who might have no idea what an "octet" is. Using a different term isn't a good option either, though, because you're likely to confuse and/or disappoint users who do know what an octet is and expected to see the correct term used in the appropriate context.

Perhaps the best compromise is daring to go beyond the typical "Error: Invalid input" style message. I would include a specific example of the input that was incorrect, along with the error text. In this case, you might show the IP address that the user entered, with the incorrect octet highlighted in red.

It requires a considerably greater amount of effort on the part of the programmer, who can no longer throw in a call to the MessageBox function and leave it at that. But there's a huge gain in usability. The advantage of this approach is that an experienced user can simply read the textual message and know exactly what needs to be fixed. An inexperienced user who doesn't understand the error can spend more time reading the dialog and still know exactly what needs to be fixed.

Consider the following concept sketch:

     More descriptive error message, with the problematic octet highlighted in red

(Obviously, you'll need to modify accordingly when your application finally decides to support IPv6.)

删除会话 2024-10-22 14:57:57

我简单地将其称为部分。因此,在您的情况下:

"The first part of your IP address is invalid."

恕我直言,没有最终用户会理解术语八位字节

更新

真的,必须在这里问这个“部分”叫什么(我认为您是这里的技术人员,编写了该应用程序)。您的用户中没有人会理解术语八位字节;)

I would simply call it part. So in your case:

"The first part of your IP address is invalid."

IMHO no end user will understand the term octet.

Update

Seriously, YOU had to ask here what this "part" is called (and I consider you to be the technical skilled person here, who wrote the application). Nobody of your users will understand the term octet ;)

喵星人汪星人 2024-10-22 14:57:57

我能想到的最接近的术语是“子网”,尽管为了验证的目的,为了清楚起见,我会使用“八位字节”,因为子网或多或少是不明确的。

The closest term I can think of is "subnet," although for the purposes of validation, I would use "octet" for clarity, since subnet is more or less ambiguous.

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