String tmpString = @"C:\Documents and Settings\Administrator\My Documents\My Pictures\";String fullString = @"C:\Documents and Settings\Administrator\My Documents\My Pictures\1.gif";String myString = fullString.Substring(tmpString.Length).ToString();
解决方案 »
- WCF部署到服务器上后可以引用,但无法调用
- C#日历问题,把日历的值付给画面上的按钮,通过年和月来变换按钮上的日历,可先弄个固定年份
- System.Runtime.InteropServices.SEHException: 外部组件发生异常
- 求助:关于SQL 多表查询
- DropDownList1控制TextBox1 事件如何写
- dataGridView手动绑定dataset的datatable后bool值的列显示不出数据
- C#实现最短路径分析
- WEB方式的程序中,点击按钮跳出新的页面,如何防止本面不被刷新.
- 关于水晶报表子报表的问题
- 100分求c# services 程序无法访问映射路径
- 急,如何重写webbrowser控件的打印
- 简单问题:为何textBox1.Select(1,2)和textBox1.selAll();不起作用
int i = str .LastIndexOf('\');string strResult = st.Substring(i);
JohnnyDJ(人不来车不往)兄弟,我另外还向请教一下,如果C:\Documents and Settings\Administrator\My Documents\My Pictures\1.gif是从某个TextBox或File Field里面读取的话,那不是确定不了C:\Documents and Settings\Administrator\My Documents\My Pictures\。
int i = str .LastIndexOf('\\');
string strResult = str.Substring(i);
string str = "C:\\Documents and Settings\\Administrator\\My Documents\\My Pictures\\1.gif";
int i = str .LastIndexOf('\\');
string strResult = str.Substring(i+1);
{
openFileDialog1.Filter = "位图文件(*.bmp)|*.bmp|图形转换格式(*.gif)|*.gif|JEPG文件(*.jpg;*.jpeg)|*.jpg;*.jpeg|图标文件(*.ico)|*.ico|图元文件(*.wmf)|*.wmf";
openFileDialog1.RestoreDirectory = true;
if(openFileDialog1.ShowDialog() == DialogResult.OK)
{
textBox1.Text=openFileDialog1.FileName;
} /*
String tmpString = @"C:\Documents and Settings\Administrator\My Documents\My Pictures\"; String fullString = @"C:\Documents and Settings\Administrator\My Documents\My Pictures\1.gif"; String myString = fullString.Substring(tmpString.Length).ToString();
label1.Text=myString;
*/
string str=textBox1.Text;
string str1 = "C:\\Documents and Settings\\Administrator\\My Documents\\My Pictures\\1.gif";
int i = str .LastIndexOf("\\");
string strResult = str.Substring(i+1);
label1.Text=strResult; }