How to save a text into a specific folder of computer(in document) by default, when the user clicks yes(for,Do you want to save the file?) to save a file into his computer? If the folder doesnot exist create and save the textfile?
At the time of file download process, teh IE thorws a dialog box asking the user open / save or cancel. How to disable the open option, i want only save or cancel. This file is a zip file. i don't want a open option, is it possible?
I am working on asp.net 3.5 in C#. In my application I have to Create folder and upload file in that folder, which works fine on my machine. I want help for create folder and upload file in that folder on other machine which is connected in LAN. code for create folder and Upload file on my machine
I want to use ActiveXControl to scan particular folder on client machine say C:HJReports
I have write simple activeXcontrol using user control in winform but I am not able to use this in aspx page using object tag possibly due to problem in classId property of object tag Here I want help on following aspects
1. How to use already made .net activeXcontrol in asp.net 2. How to make .net activexcontrol
I want to access one image file residing in C: of the client's machine. I know with the help of file upload control (or say input type=file), this would be easy. Due to nature of my application (Its a KIOSK application), user is not expected to select file. I am just wondering how should I implement reading file without using file upload control. I want to store this file in Images folder of server. I am beginner to WCF. Should I look towards WCF?
System.Diagnostics.Process.Start("C:Windowssystem32otepad.exe") i Use this codeing it work on my system but not work on server. and with the javascript it also give the error
We have a requirement to allow the cient to upload multiple files which resides in a single folder, within the client computer. To do this can we allow the client to browse for the file location and select a single file (via a normal asp file uploader), and then recursively read the necessary files from the relevant directory? Is this possible or is there any other way to do this?
I would like to ask some help from you guys on how do i do this problem. I'm using asp.net and my problem is on getting the list of filename inside the folder. Is there a function on this? I tried this on console apps there's a function like GetFileName. Hope somebody could help me on this.
i'm developing a system with asp.net, there i generate a powerpoint presentaion in the server machine, i need to generate it there and save it in the clients machine, how can i achieve this? how to access the clients machine and save the generated file there?
I'm having some trouble trying to create a page for my web app. I'm not trying to write a simple download/upload page. Should also say that I'm not trying to write a complex one.What I need to do is in the PageLoad check if the user has installed one particular software and then show the right message to download and install OR run it from the user's actual installation. For this scenario I've tried to use different file upload controls to check if the file was on the client machine, but none of then can do this, since, for security reasons,I can't programmatically set the path and file to upload.
I have developed an application where I need to create a page to read data from Excel File and then update it to the database. The code that I wrote works only when the application runs from my machine. When I deployed the application to the server it gave an error- 'C:PRFileIimport_File.xls' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides. here is mu code -
protected void InsertData(object sender, EventArgs e) { OleDbConnection oConn = new OleDbConnection (@"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\PuertoRicoFile\Puertorico_Iimport_File.xls ; Extended Properties=Excel 8.0 "); OleDbCommand oCmd = new OleDbCommand("select * from [Puertorico_Data$]", oConn); oConn.Open(); //Here [Puertorico_Data$] is the name of the sheet in the Excel file where the data is present OleDbDataReader oleDbReader = oCmd.ExecuteReader(); string AgentIP = ""; string TagName = ""; string Status = ""; string Severity = ""; int EventCount = 0; string EarliestEvent = ""; string LatestEvent = ""; while (oleDbReader.Read()) { AgentIP = (string)oleDbReader[0]; // valid(oleDbReader, 0);//Here we are calling the valid method TagName = (string)oleDbReader[1]; //valid(oleDbReader, 1); Status = (string)oleDbReader[2]; //valid(oleDbReader, 2); Severity = (string)oleDbReader[3]; //valid(oleDbReader, 3); EventCount = Convert.ToInt32(oleDbReader[4]); //oleDbReader[0]; //valid(oleDbReader, 4); EarliestEvent = (string)oleDbReader[8]; //validate(oleDbReader, 8); EarliestEvent = EarliestEvent.Substring(0, 19); LatestEvent = (string)oleDbReader[9]; //validate(oleDbReader, 9); LatestEvent = EarliestEvent.Substring(0, 19); InsertDataIntoSql(AgentIP, TagName, Status, Severity, EventCount, EarliestEvent, LatestEvent); } SqlConnection mySQLconnection = new SqlConnection(ConfigurationManager.ConnectionStrings["IssNetworkReportingSystemConnString"].ConnectionString); mySQLconnection.Open(); SqlCommand cmdSql = new SqlCommand("AddMonth_Event_TotalInfo_for_Puertorico", mySQLconnection); cmdSql.CommandType = CommandType.StoredProcedure; dbReader = cmdSql.ExecuteReader(); dbReader.Close(); cmdSql = new SqlCommand("AddQtr_Event_TotalInfo_for_Puertorico", mySQLconnection); cmdSql.CommandType = CommandType.StoredProcedure; dbReader = cmdSql.ExecuteReader(); dbReader.Close(); oConn.Close(); lblMsg.Text = "Data Imported Sucessfully"; lblMsg.ForeColor = System.Drawing.Color.Green; } public void InsertDataIntoSql(string agentIP, string tagName, string Stat,string severity,int eventCount, string eEvent, string lEvent) {//inserting data into the Sql Server SqlConnection mySQLconnection = new SqlConnection(ConfigurationManager.ConnectionStrings["IssNetworkReportingSystemConnString"].ConnectionString); mySQLconnection.Open(); SqlCommand sqlSelect = new SqlCommand("SELECT SeverityID from Severity where SeverityDesc=@SeverityDesc",mySQLconnection); sqlSelect.CommandType = CommandType.Text; sqlSelect.Parameters.Add("@SeverityDesc", SqlDbType.NVarChar).Value = severity; dbReader = sqlSelect.ExecuteReader(); int severityId = Convert.ToInt32(dbReader.Read()); dbReader.Close(); SqlCommand sqlInsert = new SqlCommand("Insert into IdsData_Puertorico(AgentIP,TagName,Status,SeverityID,EventCount,EarliestEvent,LatestEvent)" + " values (@AgentIP,@TagName,@Status,@SeverityID,@EventCount,@EarliestEvent,@LatestEvent )" ,mySQLconnection); sqlInsert.CommandTimeout = 0; //timeout unlimited sqlInsert.CommandType = CommandType.Text; sqlInsert.Parameters.Add("@AgentIP", SqlDbType.NVarChar).Value = agentIP; sqlInsert.Parameters.Add("@TagName", SqlDbType.NVarChar).Value = tagName; sqlInsert.Parameters.Add("@Status", SqlDbType.NVarChar).Value = Stat; sqlInsert.Parameters.Add("@SeverityID", SqlDbType.Int).Value = Convert.ToInt32(severityId); sqlInsert.Parameters.Add("@EventCount", SqlDbType.Int).Value = Convert.ToInt32(eventCount); sqlInsert.Parameters.Add("@EarliestEvent", SqlDbType.DateTime).Value = DateTime.Parse(eEvent); sqlInsert.Parameters.Add("@LatestEvent", SqlDbType.DateTime).Value = DateTime.Parse(lEvent); sqlInsert.CommandType = CommandType.Text; sqlInsert.ExecuteNonQuery(); mySQLconnection.Close(); }
I have a web application which is supposed to create a file on clients local mcahine as the user is not having permissions to create a file on the server on which the web application is running.Can anyone please help me with this.I came across some posts stating that it is not a security measure to create a file on clients machine, but in my case I am left with no options.