当前位置:网站首页>C # use the Browse button to obtain the file path and folder path
C # use the Browse button to obtain the file path and folder path
2022-07-18 05:27:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm the king of the whole stack
Generate folder path
private void btnChoose_Click(object sender, EventArgs e)
{ using (OpenFileDialog dialog = new OpenFileDialog()) { dialog.Multiselect = true; if (dialog.ShowDialog() == DialogResult.OK) { try { this.tbFilePath.Text = dialog.FileName; } catch(Exception ex) { throw(ex); } } }
Generate file path
Create a new one FolderDialog class ( heavy load FolderNameEditor)
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms.Design; using System.Windows.Forms;
namespace Common { class FolderDialog:FolderNameEditor { FolderBrowser fDialog = new FolderBrowser(); public FolderDialog(){ }
public DialogResult DisplayDialog() { return DisplayDialog(“ Please select a folder ”); }
public DialogResult DisplayDialog(string description) { fDialog.Description = description; return fDialog.ShowDialog(); }
public string Path { get { return fDialog.DirectoryPath; } }
~FolderDialog() { fDialog.Dispose(); } } }
Events under Browse button
private void btnChoose_Click(object sender, EventArgs e) { FolderDialog fDialog = new FolderDialog(); fDialog.DisplayDialog(); this.tbfilePath.Text = fDialog.Path; }
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/120496.html Link to the original text :https://javaforall.cn
边栏推荐
- Salesforce email sent to spam mailbox or SF email processing method not received (dkim - New CNAME version)
- Information system project managers must recite the core examination points (IV) the relationship between UML classes
- The seventh day of learning C language with small Bai challenge -- Enumeration, structure, community
- Virtual box mount shared folders
- Which securities business platform is better or safer for retail investors to open accounts
- 点灯
- STM32 IO口模式介绍
- rv的使用
- 浏览器缓存机制详解
- Salesforce Certified Sharing and Visibility Designer (SU20)认证考试总结
猜你喜欢

【动态规划】—— 数位统计DP

Salesforce email sent to spam mailbox or SF email processing method not received (dkim - New CNAME version)

nifi ListSFTP等代理设置

Proxy settings such as nifi listsftp

Information system project managers must recite the core examination points (IV) the relationship between UML classes

Fail-Fast & Fail-Safe

LSM storage model

SQL每日一练(牛客新题库)——第2天: 条件查询

Profiles vs Permission Sets

Transplantation and analysis of freemodbus on stm32f1 platform
随机推荐
Code implementation of jump between IAP bootload and app
SQL每日一练(牛客新题库)——第2天: 条件查询
面试题集合
Cool dog music interface is amazingly open
Light up
C # write a GUI tool and decompile it
STM32F103 serial port +dma interrupt to realize data sending and receiving
直播带货系统源码
Nifi listsftp intensive talk
Salesforce File Share and Security
Alibaba cloud e-mapreduce geek competition is open for registration. Hundreds of thousands of bonuses are waiting for you to challenge
散户证券开户哪个券商平台好,哪个更安全
nifi ListSFTP等代理设置
【7.8-7.15】写作社区精彩技术博文回顾
NiFi ListSFTP精讲
Fail-Fast & Fail-Safe
STM32 internal flash operation function
The 15th day of zero basic Lua --- finally, I'll summarize it
@What is tap
Salesforce发布的振奋人心的新功能集锦