将文件扩展名插入数据库 [英] Inserting file extension to the database

查看:87
本文介绍了将文件扩展名插入数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮帮我。我知道它只是一个简单的问题,但我如何只插入数据库的文件扩展名?我应该在insert语句中写什么?我想插入一个文件扩展名,如.pdf,.docx等。我已经上传了文件,所以现在我需要将该文件扩展名插入同一个表中的另一个字段。

Please help me. i know its a simple problem only but how do i insert only a file extension to the database? what should i write in the insert statement? i wanna insert a file extension such as .pdf, .docx, etc.. i've already upload the file so now i need to insert that file extension into another field in the same table.

推荐答案

使用以下代码..将变量扩展名的值插入数据库

use the following code.. insert the value of variable extension to the database
string extension = System.IO.Path.GetExtension(filename);


这篇关于将文件扩展名插入数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆