2
如何在服务器端使用Dart找到OS's architecture
?如何在Google Dart中查找操作系统架构?
如何在服务器端使用Dart找到OS's architecture
?如何在Google Dart中查找操作系统架构?
可以使用Platform
类:
import 'dart:io';
main() {
print(Platform.operatingSystem);
print(Platform.numberOfProcessors);
}
如果Platform
类是不够的,你还可以创建一个新的进程,并执行一些命令,看它是否返回有意义(如执行ps
检索过程等)。