Click here to Skip to main content
15,886,689 members
Home / Discussions / C#
   

C#

 
GeneralRe: How do I set a DataGridVew column in a ListView BOLD? Pin
CHill608-Oct-15 6:20
mveCHill608-Oct-15 6:20 
GeneralRe: How do I set a DataGridVew column in a ListView BOLD? Pin
Robert Oujesky8-Oct-15 6:28
Robert Oujesky8-Oct-15 6:28 
GeneralRe: How do I set a DataGridVew column in a ListView BOLD? Pin
CHill608-Oct-15 6:34
mveCHill608-Oct-15 6:34 
QuestionAlert message script Pin
Member 120161066-Oct-15 15:31
Member 120161066-Oct-15 15:31 
AnswerRe: Alert message script Pin
Richard Andrew x646-Oct-15 16:22
professionalRichard Andrew x646-Oct-15 16:22 
GeneralRe: Alert message script Pin
Member 120161066-Oct-15 16:31
Member 120161066-Oct-15 16:31 
AnswerRe: Alert message script Pin
Richard Andrew x646-Oct-15 16:36
professionalRichard Andrew x646-Oct-15 16:36 
GeneralRe: Alert message script Pin
Member 120161066-Oct-15 16:53
Member 120161066-Oct-15 16:53 
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;

namespace wsmfgit
{

/// <display files in listbox from directory>
public partial class downloadsoftware : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{


//Directory.CreateDirectory("C:\\DesktopCopyTemp");
DirectoryInfo info = new DirectoryInfo(@"\\192.168.5.10\fbar\TOOLS\ProbingApps\ProbingSystem\DesktopCopyTemp");
FileInfo[] Files = info.GetFiles("*.*");
foreach (FileInfo file in Files)
{
ListBox1.Items.Add(file.Name);
}

}
///</display>
/// <link to home button>
protected void imgbtn_home_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("default.aspx");
}
///</link>
///<software download button1>
protected void btn_dwn_Click(object sender, EventArgs e)
{
string File = ListBox1.SelectedValue;

Response.ContentType = ContentType;
Response.AppendHeader("Content-Disposition", "attachment; filename=" + Path.GetFileName(File));
Response.End();
}
/// </software>

protected void btn_search_Click(object sender, EventArgs e)
{
lstbox_clotho.Items.Clear();
string search=txtbox_clotho.Text;
if (txtbox_clotho.Text != "")
{
string[] licfiles = Directory.GetFiles(@"\\192.168.5.10\fbar\TOOLS\ProbingApps\ProbingSystem\Clotho_License", "*" + txtbox_clotho.Text + "*.lic", SearchOption.AllDirectories);
foreach (string file in licfiles)
{
lstbox_clotho.Items.Add(new ListItem(Path.GetFileName(file), file));
}

{
txtbox_clotho.Text = "";
}
}
}



protected void imgbtn_dwn_Click(object sender, ImageClickEventArgs e)
{
string licfiles = lstbox_clotho.SelectedValue;

Response.ContentType = ContentType;
Response.AppendHeader("Content-Disposition", "attachment; filename=" + Path.GetFileName(licfiles));
Response.TransmitFile(Server.MapPath(@"C:\Avago.ATF.Common\License" + "licfiles"));
Response.End();
}


}
}
This is my c# code:

XML
<asp:ListBox ID="ListBox1" runat="server"  style="z-index: 1; left: 406px; top: 311px; position: absolute; width: 339px; height: 163px; margin-left: 3px; margin-top: 0px"  BackColor="White" Font-Bold="True" ForeColor="#000066" ></asp:ListBox>
     gt;
        <asp:Button ID="btn_dwn" runat="server" OnClick="btn_dwn_Click" style="z-index: 1; left: 657px; top: 443px; position: absolute; height: 31px; width: 90px;" Text="Download" BackColor="#000066" BorderColor="#CCCCCC" BorderStyle="Groove" Font-Size="Medium" ForeColor="White" />
        <asp:Panel ID="Panel2" runat="server" GroupingText="CLOTHO LICENSE" style="z-index: 1; left: 401px; top: 539px; position: absolute; height: 220px; width: 359px; right: 146px" ForeColor="#000066">
            <br />
            <br />

            <asp:TextBox ID="txtbox_clotho" placeholder="Search by Mac Address" runat="server" Height="21px" style="margin-left: 45px" Width="217px" BorderColor="#333333" BorderStyle="Solid" ></asp:TextBox>
            <br />
            <asp:Button ID="btn_search" runat="server" BackColor="#006699" BorderColor="Black" BorderStyle="Groove" Font-Bold="True" Font-Size="Medium" ForeColor="White" OnClick="btn_search_Click" style="z-index: 1; left: 279px; top: 58px; position: absolute; height: 30px; width: 74px" Text="Search" />
            <br />
            <br />
            <asp:ListBox ID="lstbox_clotho" runat="server" Height="81px" style="margin-left: 47px" Width="245px"  ></asp:ListBox>
            <asp:ImageButton ID="imgbtn_dwn" runat="server" ImageUrl="~/images/download.png" Height="49px" Width="50px" OnClick="imgbtn_dwn_Click"  />
            <br />
            <br />

this is my asp.net code:
I want to show alert message when the search result invalid..
AnswerRe: Alert message script Pin
Afzaal Ahmad Zeeshan6-Oct-15 22:12
professionalAfzaal Ahmad Zeeshan6-Oct-15 22:12 
GeneralRe: Alert message script Pin
Member 120161066-Oct-15 23:04
Member 120161066-Oct-15 23:04 
GeneralRe: Alert message script Pin
Afzaal Ahmad Zeeshan6-Oct-15 23:18
professionalAfzaal Ahmad Zeeshan6-Oct-15 23:18 
Generalabout backend Pin
bittuu6-Oct-15 8:51
bittuu6-Oct-15 8:51 
GeneralRe: about backend Pin
dlhale6-Oct-15 8:56
dlhale6-Oct-15 8:56 
GeneralRe: about backend Pin
Mycroft Holmes6-Oct-15 14:17
professionalMycroft Holmes6-Oct-15 14:17 
GeneralRe: about backend Pin
bittuu6-Oct-15 19:00
bittuu6-Oct-15 19:00 
QuestionWhat happen when use 2 timer on a form. Pin
LeHuuTien5-Oct-15 21:13
LeHuuTien5-Oct-15 21:13 
AnswerRe: What happen when use 2 timer on a form. Pin
Pete O'Hanlon5-Oct-15 21:29
mvePete O'Hanlon5-Oct-15 21:29 
QuestionMessage Removed Pin
5-Oct-15 6:49
professionalN_tro_P5-Oct-15 6:49 
AnswerRe: How to SET Geo Location Pin
Gerry Schmitz5-Oct-15 7:55
mveGerry Schmitz5-Oct-15 7:55 
GeneralMessage Removed Pin
5-Oct-15 8:13
professionalN_tro_P5-Oct-15 8:13 
GeneralRe: How to SET Geo Location Pin
Gerry Schmitz5-Oct-15 9:33
mveGerry Schmitz5-Oct-15 9:33 
GeneralMessage Removed Pin
5-Oct-15 9:37
professionalN_tro_P5-Oct-15 9:37 
GeneralRe: How to SET Geo Location Pin
Gerry Schmitz5-Oct-15 10:00
mveGerry Schmitz5-Oct-15 10:00 
GeneralMessage Removed Pin
5-Oct-15 11:54
professionalN_tro_P5-Oct-15 11:54 
GeneralRe: How to SET Geo Location Pin
Gerry Schmitz5-Oct-15 12:24
mveGerry Schmitz5-Oct-15 12:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.