Click here to Skip to main content
15,895,283 members
Everything / Filepath

Filepath

filepath

Great Reads

by Varun Sriram
This article explains how to develop a custom Java utility to find and replace strings in multiple files in one go
by Laurie Stearn
Dialogex with Listbox to manipulate long paths in Windows
by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
This is a simple trick to find file names of a particular file type existing in a folder.
by Joezer BH
A simple regex that replaces ALL the illegal filename or path chars

Latest Articles

by Laurie Stearn
Dialogex with Listbox to manipulate long paths in Windows
by @nkit Bajpai
This article discuss a simple application built using WPF MVVM design pattern and explain the basics of Command Binding and DataBinding.
by Varun Sriram
This article explains how to develop a custom Java utility to find and replace strings in multiple files in one go
by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
This is a simple trick to find file names of a particular file type existing in a folder.

All Articles

Sort by Score

Filepath 

10 Nov 2015 by Jochen Arndt
In this block you are creating a QFile object with the same name as an existing object:if (nflag!=0){ QFile mFile(LoggerFileName); mFile.open(QIODevice::WriteOnly|QIODevice::Text); nflag=0;}You are opening a file but the other mFile object is still in it's previous...
18 Jan 2016 by Jochen Arndt
This is a relative path:QDir dir("../MyProjects/ProjectB");If the current working directory is not a sub directory of "C:\MyDevelopment\", the path will be probably invalid (not existing).This will return the path to the passed name relative to the above directory.LFName=...
30 Oct 2019 by RickZeeland
You can use: Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) See: Environment.SpecialFolder Enum (System) | Microsoft Docs[^] An example: string userPath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); string destFilename =...
24 May 2012 by ShaikhM
1) Right click anywhere on the report2) Select Insert --> OLE Object3) Create from File4) Select your source5) Click OKThat should do.
8 Jun 2012 by E.F. Nijboer
You'll need microsoft transaction server (mts) for this. With it, you create a transaction context, execute multiple actions (like file handling and database updates, also mixed) that all need to call SetComplete (indicating the code didn't encounter any problems). When you then call Commit, MTS...
5 Sep 2012 by OriginalGriff
Try: string src = @"D:\xyz\abc\a\folder"; string dest = src.Substring(0, src.LastIndexOf('\\'));
5 Sep 2012 by Kuthuparakkal
string path = @"D:\abc\ToZipFolder";string newpath = System.IO.Path.GetDirectoryName(path);newpath is :D:\abc
29 Apr 2013 by Sergey Alexandrovich Kryukov
It absolutely does not matter what kind of "file type" do you upload.The simplest way to upload?
20 Jun 2013 by Ron Beyer
It will be the second argument in the Environment.GetCommandLineArgs() call, which returns a string array of the command line arguments that started the program.Environment.GetCommandLineArgs() MSDN[^]
7 Aug 2013 by Manas Bhardwaj
I would personally not change the web.config dynamically. Rather create a new xml file to store those settings. Look at this article to start with how to read/write XML files.http://www.jkr.com.au/index.php/2011/08/26/read-and-write-xml-files-asp-net/[^]
20 Nov 2015 by ZurdoDev
It is likely a permission issue. Make sure the identity that is running the service has the proper permissions.
8 Jan 2016 by Sergey Alexandrovich Kryukov
You don't need to find all partitions. First of all, not all partitions have file systems. Instead, you need to find all logical drives. This is how: DriveInfo.GetDrives Method (System.IO)[^].Instead of the method Directory.GetFiles, you can use another Directory.GetFiles method which finds...
9 May 2016 by Suvendu Shekhar Giri
What you want to achieve through following line of code?File.SetLastWriteTime(path, new DateTime());If you want to set current datetime as LastWriteTime, try following-File.SetLastWriteTime(path, DateTime.Now);If you still experience the same error or if your requirement is something...
8 Nov 2019 by OriginalGriff
The simple answer is: you don't. Basically, you are storing your data files in the wrong place - you need to stroe them in a "safe" folder. Have a look here: Where should I store my data?[^] - it shows how to use places that will work on any computer.
29 Dec 2019 by RickZeeland
Try this: static int picCount = 1; public void Base64ToImage(string imagestr) { DbAccessConnection conn = getActiveConnection(); try { beginTransaction(conn); byte[] bytes = Convert.FromBase64String(imagestr); using...
29 Dec 2019 by OriginalGriff
Read all the files currently in the folder: Directory.GetFiles[^] will do that for you, and you can provide wildcards like "image*.jpg" to restrict them. Then you could just sort them by path - but with only three digits, you may start to have problems quite quickly as string based comparisons...
18 Jun 2023 by Richard MacCutchan
The folder you need to find is named OBSHOME/Itunes, as clearly shown in the error message, and (presumably) located on the old HDD. If the location has now changed then you need to change it in the Sonos application: select "Manage" -> Music...
23 May 2012 by Member 7919516
Hello,I have CR10 and i would like to insert an image via file path. I'm not using visual basic with this. I'm looking all over but can not find a solution. Any help is greatly apprecitated. thanks.
23 May 2012 by Sandeep Mewara
You need to convert the image into stream of bytes and then populate the datasource for your report. Have a look at these:How to dynamically load images in Crystal Reports using Visual Studio 2005[^]Image in Crystal Reports[^]
23 May 2012 by Member 7919516
i don't have visual studio to do this and the image is not stored in a database it's located in a file system such as \\servername\images\id\imagename.jpg any other suggestions? thanks.
8 Jun 2012 by gaurish thakkar
i want to make sure that my transaction as well as copying of a perticular file happen both simoultanously..or they dont happenhow can i achieve this...
13 Jun 2012 by Balaji1982
Hi,I have a web.config in a web application. This config file has a app-settings, that has a key, value pair. The value points to the path of a log file. i do not have any issues accessing and writing information logs, when i am running the application in my own system. when i publish the...
4 Sep 2012 by Kantesh Nagaradder
Hi All, I want to implement Opened File Monitoring so I need a C++ Code to Get Opened File Path . My aim of this Opened File Monitoring is to get Information about the files opened by the users of machine. how can i implement this please suggest me...
4 Sep 2012 by Richard MacCutchan
I am not sure that such a thing is possible without writing some sort of filter driver that monitors the system. API hooking revealed[^] is an article that shows some of the techniques that may help you.
12 May 2021 by Ali_100
Hi i have run time path,,, like@"D:\ToZipFolder";@"D:\abc\ToZipFolder";@"D:\xyz\abc";@"D:\xyz\abc\a\folder";so i need@"D:@"D:\abc@"D:\xyz@"D:\xyz\abc\aHow can i do that,,?
16 Nov 2012 by Bluemoon11i
Im beginner in php language. in my web project i created a filepath.config.ini file which stores all file path in the website directories. for eg.CLASS1 = bin/myclass1.phpCLASS2 = bin/myclass2.phpand im accessing those path by using: require...
20 Jan 2013 by Sergey Alexandrovich Kryukov
Writing a file is already totally unrelated to any dialog, and unrelated to UI in general. If you had the impression that is it related in .NET, this is only because you have no clue about .NET as well, no matter how much of code you created.Ideally, writing files should not be related to...
28 Jan 2013 by Deenuji
how to open xml file using local disk url? example my url is "C:\\Users\\FABS\\Documents\\Xml Search\\upload\\BOOK.xml" ...Now i can open this xml file from asp.net?????Actually i want to open this xml file in browser pls any one guide me????
28 Jan 2013 by Sandeep Mewara
Did you try anything? Perhaps a hyperlink with the URL of XML in your web page?
20 Feb 2013 by iGuy91
Hello everyone, I'm writing some code for a senior seminar as a business major, however I am not a strong programmer. The project involves me writing code in VBA that will go through a file directory, and produce line by line in the cells in excel the file paths for each file in the prescribed...
20 Feb 2013 by Mike Meinz
I modified the code from Solution 1 to search for ".xls" and to add to an Excel worksheet. The code below can be copied and pasted into an Excel Macro (ThisWorkBook).Option Explicit'Dim lIndex'Private Sub ProcessItem(ByVal objItem, ByVal strFolderSpec As String)'' Adds a...
21 Mar 2013 by Ankit_Sharma1987
Hello Friends, I m using File Directory , to bind Data List. I m Displaying My Code here: '...
13 May 2021 by dilzz
Dear Experts, I am Doing an ASP.net project. In that project am using Ajax JSON to transfer the datas.And am Using Javascript to read the datas from controls.But I am facing a Problem,I didn't get the Original File path when i used the file Input HTML Control...In Chrome i...
7 Apr 2013 by OriginalGriff
You can't.Security stops you for knowing anything about the filing system of the client computer - it may not even have one! It could be a MAC, a PC, a Tablet or an internet enabled fridge - you don't know, can't know and won't know. And letting you have the full path could give you some...
11 Jun 2013 by gani7787
i am getting problem in file copying from one server to another server domain in ASP.NET.server name 1 : testserver1 Domain name : testserver name 2 : testserver2domain name : testnet.see my code :SourceFilePath = "\\testserver2\fileslst\Reports\New\" & lblRenameGrid.Text...
20 Jun 2013 by sarath1er
Hi all, I am trying to create an application that reads data from a notepad(.txt file) and display the text in a richedit. Application should be started when right clicking on the notepad(.txt file) and open with my application. My problem is, how to get the path of the selected .txt...
1 Aug 2013 by Harshil_Raval
Hi,You can try like this,try{ string path = @"E:\Hamza Development Tools don't Touch This Folder\WindowsFormsApplication6\WindowsFormsApplication6\Rufus.exe"; ProcessStartInfo pinfo = new ProcessStartInfo(path); Process.Start(pinfo);}catch(Exception exc) {...
7 Aug 2013 by Charlesirwin1810
I need to store some File Paths and other Settings parameter, in Config file or XML , so that using a web page i can dynamically change, which can be read and used in global.asax
13 Aug 2013 by FoxRoot
Hello everyone,I have a website. I am developing it to develop myself. My Database conists of 3 tables. 1 is for the content.I seperated a column for the pdf file directory(type is varchar). ie (files/pdffiles/example.pdf)The problem is that;how can i add the true file directory...
13 Aug 2013 by Gopinath0072
Just provide your fully qualified pdf root path from database out value in href for example "ExampleFolderName\rootPDFFolderName\PDFName.pdf", so you can able to download the pdf by onclick the link.
21 Feb 2013 by Deenuji
i selected image using file upload control....but i'm getting stuck on how to show in image box...my code is:if (FileUpload1.HasFile){ string f2 = "df.jpg"; String fileName = FileUpload1.FileName; savePath += fileName; FileUpload1.SaveAs(savePath); Label1.Text =...
21 Feb 2013 by palani23
get the full path file u had uploaded and then pass it into the imageurl you will get the image
21 Feb 2013 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
After the below line,savePath += fileName;the path of image becomes as savePathSo, you need to use this path to assign it to image control like below.Image1.ImageUrl = Server.MapPath(savePath);Or else find the relative path of this path and assign to ImageUrl.
16 Dec 2013 by JR009
I have one Employee table in sql database, I want to add Employee Image in the table using FileUpload Control and then display that image in gridview. So how can i achive this. Plz help.
16 Dec 2013 by Tom Marvolo Riddle
Googled?You can do this by 1.Saving image in file system and its path in DB2.Saving image in DB(It occupy lot of space in DB when you have more no of records)Refer...
16 Dec 2013 by Karthik_Mahalingam
Try this link, works fine.http://forums.asp.net/t/1922364.aspx[^]If you wanna store the image file in web server and save the image path in Db you can prefer this linkhttp://www.aspsnippets.com/Articles/Retrieve-images-using-a-file-path-stored-in-database-in-ASPNet.aspx[^] Its...
16 Dec 2013 by Dinesh92
Make the field datatype of your SQL table as Binary because your going to store large file i.e. BLOB (Binary Large Object)
16 Dec 2013 by Gaurav Makwana
there is datatype varbinary just use it and make one folder in your applicatontake fileupload control from toolboxif (FileUpload2.HasFile) { FileUpload2.SaveAs(Server.MapPath(~/images/) + FileUpload2.FileName); profile_image.ImageUrl = ~/images/ +...
20 Jan 2014 by hansoctantan
Hello everyone, I'm creating my first User Control, an Image Viewer. I have a property Image (String), this works fine but not user friendly. You need to key the whole path or copy and paste the path. Can someone suggest me a code that browse all images file as a property. ...
20 Jan 2014 by Sergey Vaselenko
See OpenFileDialog[^] example on MSDN.You should specify the Filter property to allow select image files only.In your case you may use the FileNames property to get the selected file names.
16 Feb 2014 by rjs123431
Use CR11, so that you can load dynamic images using parameters.
10 Apr 2014 by hansoctantan
Solve itAdded code to Property and Reference System.DesignImports System.ComponentModel
12 Jul 2015 by adityasahver
you cant do it based on the file name, as in various locations you can have file with the same name and extension. Instead write a powershell and try to achieve what you need.
31 Jul 2015 by mayooran99
#include #include #include #include #include using namespace std;/*function... might want it in some class?*/int getdir (string dir, vector &files){ DIR *dp; struct dirent *dirp; if((dp =...
31 Aug 2015 by Nilesh Marada
I have a Windows application (not deployed, I am debugging it in my machine) written in vb, that is supposed to download a file from a server. But the application is returning a "False" when doing the File.Exists("path on the FileServer").I can access the path on FileServer from my windows...
22 Oct 2015 by Varun Sriram
This article explains how to develop a custom Java utility to find and replace strings in multiple files in one go
17 Nov 2015 by BillWoodruff
Assuming this is a Windows Forms project:1. use an ImageList Componenta. Drag an 'ImageList Component onto your Form from the 'Components hive of the ToolBoxb. at design-time add your images to the ImageList's 'Images collection; or, add them at run-time as needed.2. you can then...
19 Nov 2015 by Member 11773469
Am trying to watch a UNC Path file via FileWatcher in Windows service .Service works for local path not for UNC path. I get the below mentioned exceptionService cannot be started. System.ArgumentException: The directory name \\ServerName\Folder1\Target Folder is invalid.This was the...
4 Dec 2015 by TaRoshka
HelloI have a magento site. sometimes, import isnt completed, so in these cases products prices,images ect are not updated. Manually i have to check everyday, login into server, and go to the directory where import files are located, and if i dont find those files than start exporting again....
6 Dec 2015 by Ray Radin
If I understand correctly, you want to automate a task that is still manual without messing with the system.Which is in your case, checking the existence of files in a certain path.That should be pretty easy.Just create a script that checks the path and mails you if there are...
6 Dec 2015 by F-ES Sitecore
https://msdn.microsoft.com/en-us/library/system.io.file.exists(v=vs.110).aspx[^]
10 Dec 2015 by Srinubabu Ravilla
I have created a WPF application.In this application I am copying files synchronously as follows.using (FileStream SourceStream = File.Open(sourceFilePath, FileMode.Open)){ using (FileStream DestinationStream = File.Create(destinationFilePath)) { await...
8 Jan 2016 by DamithSL
you can use DriveInfo.GetDrives Method (System.IO)[^] and it will return list of DriveInfo then you can search on each drive using DriveInfo.RootDirectory.FullNamecheck c# - How to search all directories in all drives for .txt files? - Stack Overflow[^]
18 Jan 2016 by XamBEE
Hi,I wanted to read the file "Logfile_P_1.txt" in my application.but I want to get the full path of the file"LogFile_P_1.txt". what is the best way to get the relative path of the File in QT::Dir? because I need to test my application on Linux and some time on Windows. this is how i am...
11 Feb 2016 by Marko Ilic
Hi every one, I come in need of big help. I have a file that I want to open but the problem is that the file can be in a UTF directory (path can be in a cyrilic or latin). So I did an extensive search, read and tried almost 10 stack solution but came out empty, at this point am really...
11 Feb 2016 by Marko Ilic
The problem was that I was saving the CPP file as ANSI... I had to convert it to UTF-8. I tried this before posting but VS 2015 turns it into ANSI, I had to change it in VS so I could get it working.I tried opening the cpp file with notepad++ and changing the encoding but when I turn on VS...
11 Feb 2016 by Jochen Arndt
This is mainly a solution to the question raised in solution 1.When a file is opened in an editor, that tries to identify the encoding. With Unicode files, there may be a Byte order mark - Wikipedia, the free encyclopedia[^]. If that is present, the editor knows the encoding.If there is...
10 May 2016 by super_user
scanerio there is a folder where file is created in every 2 seconds and now i want when file is not created in 5 mint means delay time then i want alert that file not created this code is for when any last file is create/modified in folder that file date time displayed in console and i...
10 May 2016 by Garth J Lancaster
Have you tried running this as 'Administrator' ie with elevated privileges ?
4 Aug 2016 by Member 11702099
down votefavoriteI have hosted one Folder in local IIS,the folder which includes compressed files.When i'm making http request to that hosted url, it is automatically downloaded into default location i.e. Downloads.I want to select the destination path for that file saving path and...
4 Aug 2016 by Patrice T
Quote:How to extract the compressed file into defined location using angularjs or any javascript libraryI think you can't. it is a security feature.If it was possible, any web page would be able to install things on your PC.It is the user task to choose directory and to unzip files.
24 Jun 2017 by JeezyWonder
What i'm trying its open text file like this: Dim FILE_NAME As String = "C:\FileName.txt" If System.IO.File.Exists(FILE_NAME) = True Then Process.Start(FILE_NAME) Else MsgBox("File Does Not Exist") End If But the problem is that, when i give my .exe with those files to another user,...
23 Jun 2017 by OriginalGriff
Use a configuration file: Managing Application Settings (.NET)[^]
24 Jun 2017 by RickZeeland
To get the system drive in C# you can use:var p = System.IO.Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System)); In Vb.NET:Dim p = System.IO.Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System)) To get the path where the exe is: Dim strPath As...
9 Jan 2018 by Ali Al-Masry
Hey guys i am new to c++ and i`m trying to load .xml file it`s located at debug folder and "//Data/Filename.xml" how i can read it using c++ ? What I have tried: i tried using ifstream fs("//Data/Filename.xml"); but the file is always not found even if i moved it to debug folder directly ...
9 Jan 2018 by CPallini
On Windows the path separator is '\' (instead of '/'). If the path is relative then it should be "Data\\Filename.xml".
7 Feb 2018 by Abdul Rahman
I need to search for all images in folders and its sub folders and if found images {with extension png jpeg gif}, Need to copy [not move] it to a specific folder. Can anyone help me? I have tried this code. Thank you What I have tried:
7 Feb 2018 by Jochen Arndt
You have to implement a recursive file search which can be done with the PHP: RecursiveDirectoryIterator - Manual[^]. Within the iteration check for matching extensions (which can be also done using a filter) and use the PHP: copy - Manual[^] function. I suggest to try it yourself using the PHP...
21 Jun 2018 by hardiik
Hello I am looking for C# code where I give specific file/directory name, I can get list of information about applications and programs accessed that file in Windows..! What I have tried: I've tried with Filesystemwatcher available in VS
21 Jun 2018 by OriginalGriff
You can't - windows does not keep a record of what applications accessed which file by default. You may find this interesting though: Auditing File Access on File Servers – Premier Field Engineering[^]
30 Aug 2018 by Donald jeffers
Hello all, I am working on an application that connects to a unc path with credentials. My application scans the network for shared computers then the user selects the computer from a listbox and from the listbox the IP address goes to a textbox. In this textbox resides the IP address I would...
30 Aug 2018 by Simon_Whale
If I get your question properly you want to open a unc folder via you application? if so the following stackoverflow may help as it opens a windows explorer for a given path vb.net - Open remote shared folder with credentials - Stack Overflow[^] I know that it is VB.NET but should be very...
30 Oct 2019 by Techhubcoding
Hello! I need some quick help to create an application in C# that works on all useraccounts and will copy a text file from C:\Users\Techhubcoding\AppData\Local\test.txt to C:\Users\Techhubcoding\Desktop\test My userprofile is "Techhubcoding" and i want this to work for all computerprofiles. How...
30 Oct 2019 by OriginalGriff
Try: Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) it will return the user base folder: C:\Users\Techhubcoding Or: C:\Users\PaulG as appropriate.
8 Nov 2019 by i like food
I am trying to find a way to get a relative path for a text file in my Visual Studio, C#, WPF solution. Right now i have something that works great on my computer, but if the application is run on another computer it breaks when the text file is needed, because the file path is different. ...
29 Dec 2019 by Reyhan M.T
I want when insert a new base64 in web service it is create image002.jpg in my folder path because image001.jpg already in folder path. Could you help how to fix it ? What I have tried: This is my coding in webservice [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public...
11 Apr 2020 by Blazin 3330
So I am trying to learn javascript, but I cannot find a tutorial that will allow me to search a text file using a string. I am wanting to search a text file at: constant path = "./data/data.txt" And I want to search for `${server.id} prefix: ` I would then want to store the full line (as...
9 Feb 2020 by F-ES Sitecore
You can't read files using javascript. If you google how to use the html5 file api you'll find lots of examples of accessing files via the "file" input component, but that requires the user to explicitly select the file to be searched through. ...
12 May 2021 by kuldeep03091988
//Delete Last Directory from path new System.IO.DirectoryInfo(Path).Delete(true);
24 Feb 2023 by Krishna Chaitanya Bezawada (Chaitu)
Hi, I have a requirement such that if a file in particular path is deleted, then my program should kill an running exe program and sleep for 5 minutes so that my software will automatically start the same exe again. When the file is present in...
24 Feb 2023 by OriginalGriff
Add a flag which says "I have killed the external process". Set it to true when you kill it, and false when the file exists. Then all you have to do is check it just before you try to kill the EXE. The advanced version stores and restores the...
24 Feb 2023 by RickZeeland
In addition to Griffs advice: another option might be to use the FileSystemWatcher Class (System.IO) | Microsoft Learn[^]
19 Jun 2023 by ormonds
Thanks for all the help. Finally sorted it; changed the music library location, rebooted, reindexed the library but the queue showing still gave the error. Deleted the queue and navigated to a new song and it worked. This means that despite the...
15 Dec 2017 by Laurie Stearn
Dialogex with Listbox to manipulate long paths in Windows
26 Feb 2014 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
This is a simple trick to find file names of a particular file type existing in a folder.
20 Feb 2013 by Joezer BH
A simple regex that replaces ALL the illegal filename or path chars
18 Jun 2023 by OriginalGriff
Quote: Yes, that is why I said that I have asked Sonos and had no reply. I therefore asked the question as a more generic one - what places might they have saved this detail. You are going to have to wait until they do reply - there are loads of...
18 Jun 2023 by Dave Kreskowiak
This isn't a site for product support. You're going to have to go ask Sonos support where they stored all your stuff.