.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

open file

Posted By:      Posted Date: October 01, 2010    Points: 0   Category :ASP.Net

i want to strore extension of selected file in a variable.when i select a file from openfile dialog box in window application in c#

View Complete Post

More Related Resource Links

Cutting Edge: Customize Your Open File Dialog


Displaying an Open File dialog is certainly easy in the Microsoft® . NET Framework with Windows® Forms, but the resulting window is not as customizable as when you create it through the Win32® API. With Windows 2000, Microsoft added a nice feature-the places bar, which is the vertical toolbar that appears on the left side of the window to let you select a frequently visited folder.

Dino Esposito

MSDN Magazine March 2003

Moved from WinXP to Win7 - don't see choice to open file in read only or edit mode


I just recently moved from Win XP Pro SP3 to Win 7 32-bit Pro. I am logging into domain X normally. Our Sharepoint 2007 server authenticates only on domain Y. So I start Internet Explorer with "run as different user" and provide my domain Y credentials. All fine. 

In win XP, after I did this, when I click on an Excel file on Sharepoint, I would get a dialog asking if I wanted to check out and edit or open as read only. 

In win7, I don't get that choice. The file simply opens, and I get a bar at the top which allows me to check out the file if I wanted to. 

How can I restore the functionality I used to have, with the dialog for checking out the file before opening it?

Error: Do you want to save this file, or find a program online to open it?



I am relatively new to MVC , i am getting the following error when i try to browse to a page in which i have used usercontrol and within the usercontrol i have a simple grid.

Error: Do you want to save this file, or find a program online to open it?

I am returning the data from the controller like this

 var jsonData = new
                    total = 1,
                    page = 1,
                    records = myRequests.Count,
                    rows = new[]{myRequests.ToArray()                 

File open error in grid



I am using gridview control which has the option to open the file like jpg,pdf etc. The grid is under UpdatePanel template.When i try to open the file in seperate window by using the below code

If (e.CommandName = "Open") Then 

Dim path = e.CommandArgument  

Dim strNewURL As String = "<Script Language = 'JavaScript'>window.open('www.google.com')</Script>"



i am getting following error:

"Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by

i want to open vb.exe file from browser

when i click on button it is opened only on task baar not display on window

SPS 2003 : Unable to open file more than 1Mb

Hi, I work in the creation of a portal in SPS 2003. We found that some documents whose size was greater than 1 Mb can no longer be opened. Word returns a runtime error "1177". When we restart the farm ,problem is resolved but reappeared after several hours .We have tried to restart the database to see if it could solve the problem, the problem is not corrected. Then we restarted the front-end web services SharePoint, this does not work. Then we did an IIS reset,the problem is not corrected. This problem affects all types of documents (pdf, doc, ppt, xls ...). Thanks for your help. Best Regards. Mawi. + DEVELOPER

LINK : fatal error LNK1104: cannot open file 'libirc.lib'

I am trying to build my project for 64 bit windows on a 32 bit windows machine. I am getting a linking error of the kind 15>LINK : fatal error LNK1104: cannot open file 'libirc.lib' Can someone tell me the resolution for this problem?

Unable to open physical file - Operating system error 5: 5(error not found) Microsoft SQL Server: Er

I am trying to attach a database to SQL 2005. This database has not previously been attached. I have only just installed SQL.   I get the following message: Unable to open physical file "C:\ArrowSQL\Arr@Data\Arrow_data.mdf" Operating system error 5: "5(error not found)" (Microsoft SQL Server: Error 5120)".   I have loaded SQL and the database fiel and directory with the same user acccount which is a local adminstrator ont hsi machine. I have checked that I have read/write access to the file.   The machine runs Windows Vista Business. SQL has SP 2 loaded.   What causes this?

File not found error when trying to open site permissions on a blog site

We have created a simple team site and a block subsite.  When trying to edit the site permissions we see the following error.  Any ideas? When opening a blog site and clicking Site Actions - site permissions we received a new page with the following error: Error File Not Found Troubleshoot issue with Microsoft Sharepoint Foundation Correlation ID: 51b54786-f344-4474-b88e-3080c363693 Date and Time: 3/24/2010 3:03:38 PM

Sharepoint 2010 Enterprise - Word can not open file in sharepoint

Hi, In the library shared documents on my first teamsite i uploaded a word 2010 document. When i click on the document my Word starts up but i'm not able to open the document. i'm also getting the following error: could not open http://pcp/Shared Documents/cv.docx. When i upload a document via word (saving the document in the library via word) i can view it when i click on the document. But when i upload an existing document into the library i keep getting the error from above when i'm trying to open it.   Thanks TIM

Open PDF file on button click or hyperlink from asp.net

I want to open a .PDF file on button click or hyperlink. please help me.

Open file dialog for wpf

Which open file dialog should be used for a wpf application that should run on xp, vista and 7?

if ssis package writes to excel file that might be open by a user

I have written a package that writes to an excel file to a network folder. Eventually this package will run as a job. What is the best way to handle the situation where someone opens the file or inadvertantly leaving it open while the package is running and and stop the package.? No one needs to modify or write anything to this file after it is finished

OpenDialog box to open file with a double-mouse click

Hi, I am having a hard time trying to find an example that opens an opendialog box and allows the users to open the file with a Double-Click. Please help.   Thanks

How do i force SharePoint to open file automatically during check out process?

Currently, when checking out a file (doc., excel, pdf etc.) in Sharepoint, i right click on doc. and click "check out". Then a window pops up and saying " you are about to check out:...." and i choose the option of saving the file in my Local Drafts Folder. The issue is that the file does not open automatically once i click "ok" in pop up window. I have go back to file in SharePoint and click on it again to open it. How do i force SharePoint to automatically open the file, when i go through the check it out process? Thank you all for your feedback.

Problem to open infopath form : The file cannot be opened because it is not a valid InfoPath form

Hi i have a winform app which host of infopath forms. form templates and data stores in database and when user want to open/edit an existing infopath form data, it must be extract from database, save on disk and then open it to display it in formControl. my problem is that when i open form data, after it has been extracted on disk, i got this error : InfoPath cannot open the following file: C:\Users\Hamed\Documents\Visual Studio 2008\Projects\InfopathFormTest2\InfopathFormTest2\bin\Debug\d00d73e8-cf5c-4b12-b9a6-591c4ade83aa.xml. The file cannot be opened because it is not a valid InfoPath form.  The processing instruction in the file is missing or invalid. here is my code : this._fullPath = System.IO.Path.Combine(Application.StartupPath, this._dataRow.FormID.ToString() + ".xml"); this._templatePath = System.IO.Path.Combine(Application.StartupPath, this._templateRow.TemplateID.ToString() + ".xsn");if (HelperClass.ExtractToDisc(_fullPath, ASCIIEncoding.Unicode.GetBytes(this._dataRow.FormContent))) { this.formControl1.Open(_fullPath); this.txtFormName.Text = this._dataRow.FormName; } where is my problem and how to solve this ? thanks in advancehttp://www.codeproject.com/KB/codegen/DatabaseHelper.aspx

Open a file from anywhere - with credentials?

Hi; Is there a way to open a file from anywhere where I give the uri and uname/password and it gives me back a Stream to read? Including: ftp - with/without credentials http - anon, basic, digest, & windows authentication REST where you must do basic on the first request (anon returns an error message as an html page). share on the same domain - requires a different user's credentials. share on a different domain share on a workgroup computer share on a non-Windows server File in SharePoint (including forms based authentication). ??? thanks - dave Very funny video - Reporting as a Metaphor
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend