我上传了一个文件放在 D:\GLOA\Department\101021000003\101021000004.cs这个位置,
gridview中用模板显示
<asp:TemplateColumn HeaderText="原文件名">
<ItemTemplate>
<asp:HyperLink runat="server" NavigateUrl='<%# DataBinder.Eval(Container, "DataItem.File_Path", "/{0}") %>'
Target="_blank" Text='<%# DataBinder.Eval(Container, "DataItem.File_Name") %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
页面超链接指向地址如下:http://localhost:2813/Department/101021000003/101021000004.cs
但是点开后IE页面上就显示的是乱码了。
请各位高手帮忙解决下,谢谢了。
gridview中用模板显示
<asp:TemplateColumn HeaderText="原文件名">
<ItemTemplate>
<asp:HyperLink runat="server" NavigateUrl='<%# DataBinder.Eval(Container, "DataItem.File_Path", "/{0}") %>'
Target="_blank" Text='<%# DataBinder.Eval(Container, "DataItem.File_Name") %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
页面超链接指向地址如下:http://localhost:2813/Department/101021000003/101021000004.cs
但是点开后IE页面上就显示的是乱码了。
请各位高手帮忙解决下,谢谢了。
用流读取...
或者给他打个RAR吧
protected Dictionary<string, string> CIDataList;
protected Dictionary<string, string> CITimeDataList;
protected Dictionary<string, string> CIBuildDataList;
protected List<string> FileList;
protected ReadConfigData ConfigData;
protected CICollectors.Entry.Log CILog;
protected string LogPath;
protected string LogFileName;
protected string ConfigFilePath;
protected string ReportFileName; public CICollector()
{ } public CICollector( string LogPath, string LogFileName, string ConfigFilePath )
{
CIInfoList = new Dictionary<string, string>();
CIDataList = new Dictionary<string, string>(); this.LogPath = LogPath;
this.LogFileName = LogFileName;
this.ConfigFilePath = ConfigFilePath; } public void RunCollector()
{
if( IsPathError() )
{
return;
}
if( IsFileNameError() )
{
return;
}
if( IsParseConfigFileFail() )
{
return;
}
CIInfoList.Add( "pdu", ConfigData.PDUInfo );
CIInfoList.Add( "version", ConfigData.VersionInfo );
CIInfoList.Add( "projectteam", ConfigData.ProjectTeamInfo ); //执行log信息
if( IsParseLogFail() )
{
return;
}
GetCIInfoFromLogFile();
CITimeDataList = new Dictionary<string, string>( this.CIDataList );
CIDataList.Clear();
GetCIInfoFromUserPlugin();
GetCIInfoFromCommonPlugin();
CIBuildDataList = new Dictionary<string, string>( this.CIDataList );
SetReportFileName();
#if DEBUG
Console.WriteLine("Debug: Don't create xml file,Don't update ftp file.");
#else
CreateCIXML obj = new CreateCIXML( this.ReportFileName, CIInfoList, CITimeDataList, CIBuildDataList );
UpFile();
#endif
} protected void UpFile()
{
try
{
FTPClient cilent = new FTPClient();
cilent.Upload( Directory.GetCurrentDirectory() + "\\" + this.ReportFileName );
FileInfo file = new FileInfo(Directory.GetCurrentDirectory() + "\\" + this.ReportFileName);
if (file.Exists)
{
file.Delete(); //删除单个文件
}
////ftpClient.Put(Directory.GetCurrentDirectory() + "\\" + outputname);
//bool flag = FtpUpload("", "cihandler", "cihandler", "aphi.huawei.com.cn", Directory.GetCurrentDirectory() + "\\" + this.ReportFileName, this.ReportFileName);
//if (flag)
//{
// Console.WriteLine("Upload file '{0}' success.", this.ReportFileName);
// FileInfo file = new FileInfo(Directory.GetCurrentDirectory() + "\\" + this.ReportFileName);
// if (file.Exists)
// {
// file.Delete(); //删除单个文件
// }
//}
//else
//{
// Console.WriteLine("Upload file '{0}' failed.", Directory.GetCurrentDirectory() + "\\" + this.ReportFileName);
//}
}
catch( Exception ex )
{
Console.WriteLine( "Upload file '{0}' failed!", Directory.GetCurrentDirectory() + "\\" + this.ReportFileName );
Console.WriteLine( "捕获到的异常信息:" + ex.Message );
}
}