当前位置:首页>科技>所有文件源代码 名称和扩展名源代码
发布时间:2026-07-20阅读(1)

程序界面
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace WindowsFormsApplication2{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { //"E:\study\mydatabase\学生个人数据库.accdb" if (openFileDialog1.ShowDialog()==DialogResult.OK) { string f_all = openFileDialog1.FileName; string f_path = f_all.Substring(0, f_all.LastIndexOf("\\") 1); string f_name = f_all.Substring(f_all.LastIndexOf("\\") 1, f_all.LastIndexOf(".") - (f_all.LastIndexOf("\\") 1)); string f_ex = f_all.Substring(f_all.LastIndexOf(".") 1, f_all.Length - (f_all.LastIndexOf(".") 1)); label1.Text = "文件路径:" f_path; label2.Text = "文件名:" f_name; label3.Text = "扩展名:" f_ex; } } }}
Copyright © 2024 有趣生活 All Rights Reserve吉ICP备19000289号-5 TXT地图HTML地图XML地图