Hi all,
My first stackoverflow question, hurray to me.
I'm a .NET user, and my goal is as simple as finding the absolute path of the directory of my main executing assembly (the EXE file).
I have several candidates:
Assembly.GetExecutingAssembly().CodeBase
Assembly.GetExecutingAssembly().Location
AppDomain.CurrentDomain.BaseDirectory...
string exeFile = (new System.Uri(Assembly.GetEntryAssembly().CodeBase)).AbsolutePath;
string exeDir = Path.GetDirectoryName(exeFile);
string fileName = Path.Combine(exeDir, @"..\..\xml\SalesOrderXMLData.csv.xml");
Hello,
The above code works if the project is in, for example,
C:\Code\
but not if its in
C:\Documents and S...
My mod_rewrite turns accounts/create into index.php?folder=accounts&action=create, but pdt ignores it, so when I try to start a PHP Script debug session, I have to type a folder location in the file field and pdt doesn't accept.
When PDT auto generates the URL for the PHP Web Page debug session, I go to http://localhost/myframe/index.ph...
If I have a.com, a.cmd, a.bat, and a.exe files %PATH%, which one would Windows pick if I invoke just the command "a"? Is this officially spec-ed somewhere by M$?
I just wanted to wrap my gvim.exe executable with -n, but my gvim.bat doesn't appear to get run neither from the command line, nor from the Run dialog.
...
In .NET is there any API that allows me to restrict some IO operations to the specified path?
For example:
Root Path: C:\Test\
Now I want to call a function like this:
IO.Directory.CreateDirectory("../testing/",Root)
And now I want the API to handle this situation for me and do not create a folder other than the specified direct...
Hi
I am familiar with dot.tk, a free subdomain service that provides url cloaking and an api to create new subdomains programmatically. Tragically it seems to be the only one that does not do path forwarding, so if I have a mydomain.tk url pointing to myhost.com and want to access myhost.com/path/to/resource via mydomain.tk/path/to/res...
To be a little more specific:
I've built a simple multithreaded TCPServer (Java) which communicates with clients (C# / mono). On request the Clients take a screenshot and send it to the Server.
The screenshots are then displayed in a JTable. I'd like to add a tooltip to these images in the table with the same image but in another size.
T...
I want to extract just the file name portion of a path. My code below works, but I'd like to know what the better (pythonic) way of doing this is.
filename = ''
tmppath = '/dir1/dir2/dir3/file.exe'
for i in reversed(tmppath):
if i != '/':
filename += str(i)
else:
break
a = filename[::-...
How can I write a regex which will replace any file name, with it's folder path, but wouldn't match url? and wouldn't match in url? For example it should match:
/images/something.png
content/scripts/myscript.js
image.gif
/1.jpg
But should not match:
http://www.google.com/images/something.png
www.google.com/scripts/myscript.js
http://...
In System.Windows.Forms.Application there are two properties called LocalUserAppDataPath and UserAppDataPath. On this computer (running Vista) these corresponds to C:\Users\UserName\AppData\Local\CompanyName\ProductName\ProductVersion and C:\Users\UserName\AppData\Roaming\CompanyName\ProductName\ProductVersion
What is the difference bet...
Is there a way to achieve the following?
In my /www/var/public_html/index.php file i have this
<?php include('database/connect.php'); ?>
And then in /www/var/public_html/database/connect.php, I want to do something like this
<?php
$my_path = get_path_of_current_script(); // should not be path of index.php
echo $my_path;
// should p...
Hi, I have a code to exporting dataset to excel working fine, I want to exporting the excel into a specific location on the server, my code is down here and what changes should I do: Any ideas?
public static void ExportDataSetToExcel(DataSet ds, string filename, string path){
HttpResponse response = HttpContext.Current.Response;...
I am looking for an existign path truncation algorithm (similar to what the Win32 static control does with SS_PATHELLIPSIS) for a set of paths that should focus on the distinct elements.
For example, if my paths are like this:
Unit with X/Test 3V/
Unit with X/Test 4V/
Unit with X/Test 5V/
Unit without X/Test 3V/
Unit without X/Tes...
Hi,
I am trying to make an application for drawing shapes on screen by touching it.
I can draw a line from one point to another- but it erases on each new draw.
Here is my code:
CGPoint location;
CGContextRef context;
CGPoint drawAtPoint;
CGPoint lastPoint;
-(void)awakeFromNib{
//[self addSubview:noteView];
}
-(void)touchesMoved...
Possible Duplicate:
Cant get the complete address while uploading a file
I need the full path.
I'm trying to give the functionality of local bookmarks, ie user wants to access c:\MyStuff\Myfile.xls on their local Pc.
How do I save/get that value without having to make a tutorial help page on how to cut and paste c:\MyStuff\Myfil...
Whenever I try to attach any file from HTML page in web browser(either Google chrome or Mozzila) and send to Servlet, I'm getting just getting the name of the file without having it's complete path. If I make an attachment of any file from C drive, I'm not getting it's complete address. And whenever I try to send this file name to mail ...
Hi,
I have made some changes in a python module in my checked out copy of a repository, and need to test them. However, when I try to run a script that uses the module, it keeps importing the module from the trunk of the repository, which is of no use to me.
I tried setting PYTHONPATH, which did nothing at all. After some searching a...
Is there a way to modify the PATH environment variable in a platform independent way using python?
Something similar to os.path.join()?
...
"I need to fetch the absolute file path of any .mdzip file opened in Eclipse editor. The MDZIP file corresponds to a Magicdraw project which can be opened in Eclipse after integrating the Magicdraw plugin into Eclipse.
Normally, the path of opened file in Editor can be fetched by using:
FileStoreEditorInput fipp = (FileStoreEditorInput)...
We were discussing this problem in class, and were unable to come up with a solution I found satisfying.
The problem:
Find the shortest path through a graph in efficient time, with the additional constraint that the path must contain exactly n nodes.
We have a directed, weighted graph. It may, or may not contain a loop. We can easily f...