急!求c#客户端删除服务器图片 同学,你的意思是 web方式吗?要有权限,而且路径要正确。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在服务器 写一个web服务就行了!! Webservies写个方法把参数用byte[]传进去!! aspx 代码部分<form id="form1" runat="server"> <div> <asp:ListBox ID="ListBox1" runat="server" Height="210px"></asp:ListBox> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="删除所选择的图片" /> </div> </form>cs 代码部分 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ListBox1.Items.Clear(); DirectoryInfo dir = new DirectoryInfo(Server.MapPath("~/pic")); foreach (FileInfo i in dir.GetFiles()) { ListBox1.Items.Add(i.Name); } } } protected void Button1_Click(object sender, EventArgs e) { FileInfo i = new FileInfo(Server.MapPath("~/pic") + "/" + ListBox1.SelectedItem.Text); i.Delete(); ListBox1.Items.Remove(ListBox1.SelectedItem); Response.Write(i.FullName); } 上例需要引用System.io 命名空间。 RadioButtonList的用法 c# 图片 部分覆盖 ListBox中怎么改变选中项的值? 自定义控件问题 c# 控件使用问题??? richtextbox加载文本文件时progressbar的使用 SQl简单问题 如何捕捉键盘上输入的Ctrl、Alt、F4等特殊键,是不是用转义字符,是的话转义字符是什么啊! 请高手进来帮我看看这小段JS代码。 24.6 + 12.3 不等于36.9! double 运算引发的的错误 关于界面设计 请指点~ c#代码如何实现将swf文件转换成scr屏保文件
<div>
<asp:ListBox ID="ListBox1" runat="server" Height="210px"></asp:ListBox>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="删除所选择的图片" />
</div>
</form>cs 代码部分 protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ListBox1.Items.Clear();
DirectoryInfo dir = new DirectoryInfo(Server.MapPath("~/pic"));
foreach (FileInfo i in dir.GetFiles())
{
ListBox1.Items.Add(i.Name);
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
FileInfo i = new FileInfo(Server.MapPath("~/pic") + "/" + ListBox1.SelectedItem.Text);
i.Delete();
ListBox1.Items.Remove(ListBox1.SelectedItem);
Response.Write(i.FullName);
}