Click here to Skip to main content
15,895,746 members
Everything / Path

Path

path

Great Reads

by The Zakies
we would create Hand_tool to pan through the drawing form, and we would use a custom cursor of open and closed hands
by Издислав Издиславов
Showcase for simple techniques for XAML button styling
by veen_rp
An add-on tip to articles already posted on Code Project
by ToughDev
How to identify used and unused resources in VS Project Resources.resx file

Latest Articles

by Jason Sultana
A look at some injection-style vulnerabilities
by ToughDev
How to identify used and unused resources in VS Project Resources.resx file
by Raj Kumar79
Create a new task and set up a IIS restart using Windows 10 Task Scheduler
by Издислав Издиславов
Showcase for simple techniques for XAML button styling

All Articles

Sort by Score

Path 

29 Jun 2016 by The Zakies
we would create Hand_tool to pan through the drawing form, and we would use a custom cursor of open and closed hands
6 Sep 2020 by Издислав Издиславов
Showcase for simple techniques for XAML button styling
23 Oct 2014 by CHill60
What you are after now is Environment.GetCommandLineArgs[^]NB - the element [0] is actually the executable name, so you will want to use element (1) i.emyDestination.Text = Environment.GetCommandLineArgs(1)The following should handle pathnames that include spacesmyDestination.Text =...
21 Feb 2017 by Karthik_Mahalingam
Since the path is empty/null on page load, it will result in argument exception, ( based on info from screenshot)FolderBrowserDialog obd = new FolderBrowserDialog(); if (obd.ShowDialog() == DialogResult.OK) { string path = obd.SelectedPath; ...
31 Aug 2017 by RickZeeland
In addition to the nice article mentioned by Graeme (which deserves points really) Making Transparent Controls - No Flickering[^] , the following: If you want to "punch a hole", this article might be of interest: Phil Wright : Component Factory: .NET2, Transparent controls[^] Also using...
13 Oct 2020 by OriginalGriff
You are doing it very wrong: your Form2 shouldn't know that Form1 even exists, but less what properties or fields it has. As soon as I see the keywords public static it's obvious you are going wrong - you shouldn't need to be using static...
8 May 2023 by ToughDev
How to identify used and unused resources in VS Project Resources.resx file
25 Jun 2012 by Pascal Ganaye
An IStream is often a FileStream and filestream have file path.But not all IStream are files.I am not sure what language you use but typically you'd have to check for the type. if (stream is FileStream) filename = ((FileStream)stream).Name;
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
6 Mar 2013 by vinodkumarnie
Try below.. .first_image,.second_image,.third_image { text-decoration:none; color:#565656; cursor:pointer; } .first_image:hover,.second_image:hover,.third_image:hover { text-decoration:underline; color:Orange; } ...
23 May 2013 by Mayur Panchal
You are doing right thing. It is returning right path of your application. Because you are currently developing your application executable file of your application is in 'bin' folder. But when you will install your app in any system it will return the exact path where it is installed.
22 Jun 2013 by Radu-Stefan Zugravu
Hi,I am trying to write an algorithm to find a path (not necessarily the shortest one) between a given start and end point.An user will enter the start location, the end location and the available time to travel. For each eadge of my graph I know the cost in time to traverse that edge...
11 Oct 2013 by ASP.NET Community
Web.Config           
3 Oct 2014 by bling
You have to find the device path, open it, and then enumerate the interfaces to find and open the interface needed.The code for this is messy because the API behavior and preferred practices of USB drivers changed from XP, to Vista, 7, and now Windows 8.Looks like you're doing that with...
25 Nov 2014 by Zoltán Zörgő
Technically you can do that with file:// protocol, but with one condition: this url will point to a local resource - with othe words a resource visible from client side. Sometimes you might need to do that, for example in an enterprise environment. But in general, when you don't know anything...
18 Dec 2014 by BacchusBeale
You need a method such as:string dir ="path";if(Directory.Exists(dir)==false) Directory.CreateDirectory(dir);
6 Jan 2016 by koolprasad2003
What are accessing from network ? it seems your database connection is go on lose, please check if it really work
4 Jan 2016 by Steve 262877418
Different resource paths using in WPF XAML file
2 Apr 2017 by CHill60
Use thePath = "c:\mdb" or get the user to type in the correct path when the InputBox is shown
23 May 2017 by stivanov
This is the solution: c# - Associated extension doesn't send file name to application on double click - Stack Overflow[^]
17 Jul 2017 by Richard MacCutchan
Please stop reposting this question. You have received a number of suggestions already. If you really cannot solve such a basic issue then you should go back to your study guides and do some serious reading.
28 Jan 2018 by Patrice T
cmd.CommandText = "insert into student_info values('" + textBox1.Text + "','" + img_path.ToString() + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "')"; Not a solution to your question, but another problem you have....
3 Sep 2018 by OriginalGriff
For starters, don't do it like that. To go up, it would have to proceed the exe file name: \RAF\bin\Debug\..\..\..\..\RAF.exe And since an initial backslash means "from the root directory" you can't go up that many levels anyway. But ... as I said, don't do that. The reason I say that is simple:...
19 May 2019 by OriginalGriff
Quote: i just have a bunch of random parts. Can somebody help me put this code together so it flows fluently? No, that isn't how development works. Instead, sit down, read the question and start from the beginning. You know how to get a value from the user, so do that. Then create the space -...
19 May 2021 by Chris Copeland
I was able to find an example of embedding sound files just by doing a quick Google: c# - Playing sounds in WPF as a resource - Stack Overflow[^] You need to embed the sound file as a resource in the executable, and then use the resource in the...
25 May 2021 by Richard MacCutchan
The system does not allow you to write in the root of the C drive. You should always store user data in one of the locations belonging to the user: Documents, AppData\Local etc.
25 May 2021 by Chris Copeland
I think the exception probably speaks for itself, your application is trying to write to a directory when it doesn't necessarily have the permissions to do so. As a safety precaution the C:\ directory is likely protected by administrator rights....
25 May 2021 by OriginalGriff
To add to what the others have said, have a look here: Where Should I Store My Data?[^] - it suggests some much better places.
8 Jun 2021 by Chris Copeland
I'll sneak in before Griff manages to do his thing, you should take a look at Where Should I Store My Data?[^] which gives examples of why storing data in the application directory might not be a good idea. If the application is installed in a...
3 Jul 2016 by The Zakies
we will continue the functionality of the hand tool with having a navigator panel which works as a map, we will also have a red rectangle which tells the user where he is actually viewing inside the whole form, also it can be moved to pan the form
12 Mar 2024 by Jason Sultana
A look at some injection-style vulnerabilities
18 Jun 2012 by ♥…ЯҠ…♥
Finally i configured and overcome the error successfully.http://learn.iis.net/page.aspx/566/classic-asp-parent-paths-are-disabled-by-default/[^]In windows xp machine 1) Goto IIS Manager(Run--> Type inetmgr)2) Navigate to "Default Web site"--> Right click and select...
25 Jun 2012 by TinDude
I am implementing the interface IInitializeWithStream.Ovw here I am able to retrieve only a file name through it's function Initialize().Where as I require the absolute path of the file for further processing. Is there any way we can retrieve this
29 Jun 2012 by svknair
i have a reports folder in my app folderi need to give thhe path but i am not able to get the path i always get the path as physical path of application/debug/reportbut report folder is in the application root path
29 Jun 2012 by Tim Corey
It sounds like you are running your application in debug mode in Visual Studio. In that case, the root path for your application is the debug folder. That is where your exe file is that you are running. If you want to include a directory in your application that has reports, you need to add...
29 Jun 2012 by Ahiri
hi, you can find root path by using Application.StartupPath this is used at both place at client side and your developing side also, its returns root path of your .exe file.I Hope this will help you.All The Best:)
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,,?
12 Dec 2012 by kishanthakar
I am trying to download resume file from folder nameed as strjobID and file name is stored in CommandArgument of grid view , but while execution I am Getting this Exception'D:/AdminApp/Jobportals/Utils/ApplicantFiles/27/directory.txt' is a physical path, but a virtual path was...
16 Dec 2012 by conanzz
I`ve connected an web page with access database, when I try to add a new record, I get this error:(Could not find file 'C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\10.0\DataBase.accdb'.)note: my data base is already in App_Data folder.and when I copy db file into...
16 Dec 2012 by Richard MacCutchan
The message is quite clear, you are trying to use a path to a file that does not exist. Your error is most likely because you are using a relative path for your database in your connection string (.\DataBase.accdb). Change your path to the correct location of your database and try again.
16 Dec 2012 by conanzz
Thanks, been solved by this path String:"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\DataBase.accdb"
7 Jan 2013 by Sergey Alexandrovich Kryukov
One of the answers to this questions describes the algorithm: http://stackoverflow.com/questions/1830607/complexity-of-finding-all-simple-paths-using-depth-first-search[^].You can find a lot more, just Google for it. This topic is quite popular.—SA
5 Mar 2013 by saibansal
function mobile(links) { if (links == 1) { document.getElementById('theImg').src="http://img.tfd.com/wn/51/64E60-alpha-test.jpg"; } if (links == 2) { ...
23 May 2013 by Am Gayathri
I want the path of my application for following code,Dim Report As New ReportDocumentReport.Load("D:\xxx\xx\x\ Report.rpt") instead of hard coding the path i need it using codeso i tried following codefilepath = Path.GetDirectoryName(Application.ExecutablePath)but it is...
23 May 2013 by Aarti Meswania
try thisdim fullPath as string = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBasedim pathOnly as string = fullPath.SubString(0, fullPath.LastIndexOf("\")) & "\Report.rpt"Happy Coding!:)
23 May 2013 by Am Gayathri
Solution :Dim path As String = Replace(filepath, "\bin", "\Report\ExibitSummeryReport.rpt")filepath = Path.GetDirectoryName(Application.ExecutablePath)Dim Report As New ReportDocumentReport.Load(path)
23 May 2013 by Nirav D Parmar
using this Dim Report As New ReportDocumentDim str as string = string.emptystr = Server.MapPath(Report.rpt)Report.Load(str)
23 Jun 2013 by Bernhard Hiller
Routing algorithms try to minimize costs - measured by the distance or by the travel time. I'd naively try to translate your problem into such an optimization. I am not sure whether following idea works:Assume a number of POIs per travel time (take the maximum or a value above it). When you...
11 Oct 2013 by ASP.NET Community
Use the Image control to display an image on the Web Forms page. Setting the ImageUrl property specifies the path to the displayed image. You can
11 Oct 2013 by ASP.NET Community
The SiteMapPath (also known as breadcrumb) control is a navigation control that allows the user to know the current page location with respect to the
11 Oct 2013 by ASP.NET Community
XML namepace has XmlWriter class to write to XML file. Code in C#:using System.XML; //Add this namespace to use XmlWriter and XmlReader
17 Oct 2013 by Yafa Su
I have a multilingual website that content 5 folders for each language in a server.Each language folder has it own path url and folder such as inc, css, js folders.But all of them are in the same root.With a .htaccess written as:php_value include_path...
13 Mar 2014 by pkmonga
I have to specify path for cookies for particular domain in c# So that cookies will be accessible to that application only. Tried out by giving Cookie.Path using Folder Name in application e.g./Try/ or /Try but it is creating ".AspxAuth" cookie but user is not able to login as Current.user is...
13 Mar 2014 by Krunal Rohit
The ASPXAUTH cookie is used to determine if a user is authenticated.So there might be a possibility that you're User is not authenticated, that is why you're getting it as a null.So focus on that :)-KR
10 Jul 2014 by Ramón Alberto Castaños Bautista
Hi Community!I have this situation.I have a Silverligth 5 application, and I need access to Operative System Folders, just I need save the path, but the application show me an error about Permissions.What can I do with this problem?Search the web about my problem, and i found to...
28 Jul 2014 by ErikVabo
This is my code behind.protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Download") { string Filepath = e.CommandArgument.ToString(); string path = MapPath(Filepath); ...
28 Jul 2014 by _Amy
I think your error is in Mapping the path. You did MapPath(Filepath) already. So, Filepath is already a local path, but you pass it to a method that expects a virtual path to convert.  --Amy
12 Aug 2014 by MinChanSike
I can't open Visual Studio 2010 & Visual Studio 2012 in my new Windows 7 64 bit.The error is Exception has been thrown by the target of an invocation when application start.I already install Visual Studio Update 2010 & 2012.Some command they say because of environment path more than 2048...
12 Aug 2014 by Richard MacCutchan
This error can be cause by many different situations and it is impossible to diagnose from the information provided. I would suggest you try:Contact Microsoft for assistance. OrRe-install Visual Studio, one at a time, and see if the problem still occurs.
30 Sep 2014 by looterhunter7
If I have device will transfer data under interface 2 endpoint 7but I have no idea how to get device path of interface 2 endpoint 7my code by step as below:// declaredSP_DEVINFO_DATA devInfoData;SP_DEVICE_INTERFACE_DATA deviceInterfaceData;PSP_INTERFACE_DEVICE_DETAIL_DATA...
22 Oct 2014 by SirLearnAlot
I solved the problem. I changed selectedValue method to selectedIndex, then I changed each option to correspond with index values from 0 - 2.Provided working code, thanks to all who tried to help!private void Tracking_Button_Click(object sender, RoutedEventArgs e) { ...
23 Oct 2014 by Sergey Alexandrovich Kryukov
In addition to Solution 1:Please see my article where I suggest an easy to use command-line parsing library, another one I would recommend is referenced in my article: Enumeration-based Command Line Utility[^].—SA
28 Oct 2014 by Kinna-10626331
Hi ,as a test I am adding as background of a Grid column a DrawingBrush element which using PElipseGeometry draws something similar a strech ellipse.Here is the code: ...
30 Oct 2014 by AeroClassics
Make you map using Adobe Illustrator or Photoshop. Then import the file into Blend. When it is imported you will see all the Path Objects with data. Copy these into you XAML file and use them.I do this when adding glyphs to my buttons.Doug
25 Nov 2014 by Member 11058906
Hi,MVC 4 C# app, I need to allow users to access files from folders that are out the virtual directory, files are created by another app every month.1. I do not want user see physical path of files likefile1Could you...
11 Dec 2014 by neveen neveen
Hi, I work on a project robotic path planning using particle swarm optimization I analysis the environment but I don't know how can I compute the cost to the neighbor and how can analysis this environment to compute th cost ,I want any reference or code on this please
11 Dec 2014 by George Jonsson
You could look into Dijkstra's Shortest Path[^] algorithm.There are plenty of articles here at Code Project if you search for 'Dijkstra'.
17 Mar 2015 by Member 11091382
Hello,I'm trying to draw in a WPF Canvas, some polylines with border.For that purpose i've used a StreamGeometry, a PathGeometry and a "Path".This is my code: StreamGeometry geom = new StreamGeometry(); //this method fills the StreamGeometry with a polyline ...
18 Mar 2015 by Gocoolprasad
canvasGeomentry.Child.Add(new Polyline()){Points=new PointCollection(new List(point)){new Point (x1,y1), new Point(x2,y2);}}
30 Mar 2015 by Salomon Pineda Silva
hello communityI'm trying to do the following:1- I did a stored process via a parameter input, where some validations ago and finally generates a txt file.2- text file is created on a path that was defined in the code  The process generates the file successfully. My question is...
30 Mar 2015 by Mark Farmiloe
TrySystem.Diagnostics.Proces...
31 Aug 2015 by Exposedv
Hello, I have software installed at www.mydomain.com (video-share script) and I have wordpress software installed at www.domain.com/wordpress I'm redirecting visitors to land on www.mydomain.com/wordpress - and from there, I direct them to different parts of the video-share...
10 Sep 2015 by Member 11974091
How do I return values from datarow to datatable: "Filtre.ImportRow" return null ?using System;using System.Collections.Generic;using System.Data;using System.Data.Entity;using System.Data.SqlClient;using System.Linq;using System.Web;using System.Web.Mvc;using...
10 Sep 2015 by Enemali William
foreach (var dataRow in dr) { filtre.ImportRow(dataRow); }Of what use is your foreach statement since you are just returning a row ? Are you trying to get the columns in the row because dr is already a datarow. You can use this to just add the retrieved row...
16 Oct 2015 by Daniel Miller
I recommend this resource:Graph Algorithms in T-SQLHere you will find a stored procedure to implement Dijkstra's algorithm, solving the shortest path from one node to all other nodes in a weighted graph. I hope you find this helpful.
2 Nov 2015 by Richard MacCutchan
Please do not repost the same question more than once. I already answered this at linker crash in C++/QTwhile access DLL file[^].
6 Jan 2016 by Member 10815016
Hi,I am trying to show EditItemTemplate in Datalist control, when i run in my pc (local) its working successfully but when i upload project to host and run edit button in profile page after 17-18 seconds its showing error "The network path was not found". Here is error error records, i m...
4 Feb 2016 by bugsoul
I created a java app with netbeans. And, I use sqlite database this like.Class.forName("org.sqlite.JDBC");Connection con = DriverManager.getConnection("jdbc:sqlite:mydatabase.db");This is my application files in "dist" folder when I was build project with right...
12 May 2016 by oronsultan
Hey guys, need some help asap!i have a "create new user" window which in it i have an option to take profile image. Now, the profile image, when loaded, is entered inside System.Windows.Shape.Path control in an imageBrush control and inside the path.Data i have CombineGeometry with...
12 May 2016 by oronsultan
Simpley as can be, the solution is:private void SnapShot() { RenderTargetBitmap rtb = new RenderTargetBitmap(Convert.ToInt32(pathBack.ActualWidth) , Convert.ToInt32(pathBack.ActualHeight), 0, 0, PixelFormats.Pbgra32); pathBack.Clip = circle; ...
10 Jun 2016 by dipesh deb
I have two folders path. One is fixed - suppose "D:\Test". And another is variable, it may be under "D:\Test" tree (e.g,"D:\Test\abc\xyz" etc.) or in any other place of the local / network places. If the variable folder is under the fixed folder tree, message box - "Found in the folder" ...
23 Oct 2016 by Warrior_Knight
I am working on a Snake AI game. I want to use BFS/A* to find the shortest path to the food. I know the coordinates of the food. There are other snakes on the board so I am trying to avoid them. I have the logic but how can I use BFS/A* to find the path? For example my snake's head's coordinate...
20 Mar 2017 by Member 13072382
Paths:echo $PATH: /usr/local/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/me/.rvm/binPYTHON PATH:...
20 Mar 2017 by Member 13072382
CLOSED:Reinstalled everything.
23 May 2017 by Anudeep Jaiswal - MCA
Use FileInfo Class Of system.IO Namespace.
16 Jul 2017 by Atlapure Ambrish
You can do something like this before your if condition. Call the below method to get the path and then check if the path exists, if not create the directory. public string GetTemporaryDirectory() { string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); ...
17 Jul 2017 by RickZeeland
Imports System.IO Dim temp as String = "C:\temp" Dim folderName as String = Path.GetRandomFileName() Dim combination As String = Path.Combine(temp, folderName) Directory.CreateDirectory(combination)
22 Aug 2017 by Member 13359351
HI I want to encrypt a file by relative file. I use this code to encryption. private void EncryptFile(string inputFile, string outputFile) { try { string password = @"Cortex98"; UnicodeEncoding UE = new UnicodeEncoding(); byte[] key = UE.GetBytes(password); ...
22 Aug 2017 by OriginalGriff
Look at the error message: An unhandled exception of type 'System.IO.DirectoryNotFoundException' occurred in mscorlib.dll Additional information: Could not find a part of the path 'C:\Users\Qsk\Desktop\FINFORM\cortexForm\bin\Debug\lib\corte‌​x\vCom.cortex It couldn't be a lot clearer! It is...
1 Sep 2017 by newbie1992
hello morning everyone anyone know how to crop (make a rectangular hole in) a control? i try to crop a square in the middle of the panel for an example if the size of my panel was Panel myPanel = new Panel() { Size = new Size(300, 800), Location = new Point(0,0); BackColor =...
3 Sep 2017 by BillWoodruff
using System.Drawing; using System.Windows.Forms; namespace PathStuff { public static class PathExtensions { public static void MakeHole(this Control cntrl, Rectangle xrect) { var region = new Region(cntrl.ClientRectangle); region.Exclude(xrect);...
25 Nov 2017 by Member 13485513
I am doing a project to code the A* algorithm in the shortest path problem. In able to determine the shortest path using A* algorithm, I acknowledge that we have to get the heuristic value first. Do anyone know how to calculate and determine the heuristic value for each nodes? [i made up the map...
25 Nov 2017 by Richard MacCutchan
A* search algorithm - Wikipedia[^].
19 Jul 2018 by Member 13917889
Forgot to name the file... System.IO.TextWriter stm = new System.IO.StreamWriter(new System.IO.FileStream(@"D:\\TEST\Data.csv", System.IO.FileMode.Create), Encoding.Default);
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...
3 Sep 2018 by Galarist_00
I have two project folders. I demonstrate my folders: A Project_Folder - bin -- Debug (default folder if I use a path like : @"FileName" B Project_Folder - bin -- Debug --- RAF.exe So from the default folder (A Project_Folder) I would like to choose the RAF.exe file from the B section. What I...