如何在服务器端使用 Dart 找到操作系统的架构
?
最佳答案
您可以使用Platform
类:
import 'dart:io';
main() {
print(Platform.operatingSystem);
print(Platform.numberOfProcessors);
}
如果 Platform
类还不够,您还可以创建一个新进程并执行一些命令以查看它是否返回有意义的内容(例如执行 ps
来检索进程等)。
关于dart - 如何在 Google Dart 中找到操作系统架构?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13043581/