zoukankan      html  css  js  c++  java
  • MAXScript调用DOTNET的OpenFileDialog

    MAXScript中可以通过System.Windows.Forms.OpenFileDialog来获取文件的全路径

    --创建OpenFileDialog
    theDialog=dotNetObject "System.Windows.Forms.OpenFileDialog"
    --设置对话框的标题
    theDialog.title="请选择文件"
    --设置可以多选
    theDialog.Multiselect = true
    --过滤文件的类型
    theDialog.Filter="Max文件(*.max)|*.max|所有文件(*.*)|*.*" 
    --设置默认的文件过滤下拉列表是"所有文件"
    theDialog.FilterIndex = 2 --显示对话框 将选中结果赋值给变量result result = theDialog.showDialog() --关闭对话框后 将result转换成字符串 result.ToString() --当按下OK 返回true result.Equals result.OK --当按下Cancel 返回true result.Equals result.Cancel --文件名最后以数组的方式返回 theFilenames = theDialog.fileNames
  • 相关阅读:
    Reverse Linked List
    Sqrt(x)
    Convert Sorted Array to Binary Search Tree
    Remove Linked List Elements
    Happy Number
    Length of Last Word
    Pow(x, n)
    Rotate Image
    Permutations
    Integer to Roman
  • 原文地址:https://www.cnblogs.com/amixc/p/4000269.html
Copyright © 2011-2022 走看看