file path shortener c# [closed] - c#

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
So I am using the StreamReader class, and in the spot where my address goes I have #"S:\Temporary Shared Space\Project\Boyscout3\Data\full_pack.txt" My colleague believes that instead of typing out that super long filename there is a short way of getting it done. My colleague believes that you can just put in #"full_pack.txt*" and it will look for all file names in your computer that has that name. Is my colleague crazy or is this an actual thing?

My colleague believes that instead of typing out that super long filename there is a short way of getting it done.
It depends on what context you are executing the program in. You can use a relative path to make the string shorter (and more flexible).
My colleague believes that you can just put in #"full_pack.txt*" and it will look for all file names in your computer that has that name.
I don't know why you added a * but unless you are using a search method you will need to remove that character. "full_pack.txt" that will grab full_pack.txt from the current directory, wherever that is.

Related

In c# is there a way to find and open a URL that exists without knowing the exact path? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
As part of a program I'm trying to have it open a URL that I know exists on the internet, but I don't know a portion of the path because it contains a unique identifier.
For example in the URL structure:
https://(I know this).com/(I know this)/(I only know one keyword that exists in here)
So essentially I need a method that finds a URL containing the parts and keyword I know, and fills in the rest of the path that I don't know.
Thanks!
Despite everyone tells you it's impossible, there is a partial way around. Just use google.
For example, the link for this question is:
In c# is there a way to find and open a URL that exists without knowing the exact path?
The query I search:
site:(stackoverflow.com/questions/63655178 AND knowing)
The result is exactly this question.
And if I specify query differently:
site:(stackoverflow.com/questions/63655178 AND not AND knowing)
I get nothing in url, though content still match.
Disclaimer
This only works for public available links which crawled by google crawler (through special navigation files and/or plugins provided by site hosters).
Also, Google can filter some search results, based on region/law/site crawl frequency, so most of the time you probably find what you looking, but do not expect correctness at 100% and immediate result.
This also work in some other search engines, syntax differs, downsides pretty much same.

Register a plugin in CRM [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 1 year ago.
Improve this question
I have read the following documentation on MSDN about how to register plugins.
I don't understand the the bolded part, perhaps someone can explain what it means:
If so, you must enable custom code on the server and try again. For
more information see
c3ee3447-ec0d-494e-8b35-4ec58ce93eea#bkmk_enablecode.
For more information see Guid- hash tag- bkmk_enablecode, I mean, i have read a lot of technical threads, but this makes no sense to me !
What is this?
Looks like a link to a KB article that went wrong. My guess is that they want you to go to this location.
For the record, I've done mostly on-line stuff so on-prem is not my strongest suit. However, the guess above (please keep in mind it's a guess, although an educated one) should still be valid.

More direct way of duplicating Visual Studio project? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 9 years ago.
Improve this question
I've been searching for how to duplicate a solution. In my case, I just want to move my solution to a new directory (it got created in the Visual Studio directory under "Projects" and I want it to be in the folder for the course I'm taking).
I understand there is the problem of absolute paths. But the only things that should have absolute paths are resources like pictures I'm using or stuff like that. I'd be happy to do those by hand.
To help me understand why it is so complicated, maybe someone can explain why there isn't simply a "save as" sort of option.
Here are two places I've looked at so far:
http://social.msdn.microsoft.com/forums/en-US/a0847416-392c-4ce3-8e9c-40cb7f0f2a27/visual-studio-c-how-to-copy-a-project
http://bytes.com/topic/c-sharp/answers/866577-how-copy-entire-visual-c-solution
Why can't save-as at least just update the automatically generated paths?
Just copy paste the entire solution directory to a different location.
Why can't save-as at least just update the automatically generated paths?
Because your solution can have items included from the "outside" (outside the solution root dir).
BTW, don't forget to manually change project guids if some projects from your solution_s_ can eventually end up in one (common) solution.

Default User Agent (WebClient Header) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Long explanation made short, I NEED to supply a proper user agent when posting data to my server; Why? I don't know entirely.
In any case, I've read that making a web request prior and grabbing the header from it would suffice, but I'd like to know if there's a more cleaner/sufficient method.
You can indeed just grab one from your favourite browser, or pick one from here.
The user agent string is just that - a string containing various info about the browser. So it's just a matter of passing it along with you request. If your program will live for a while, I'd try to pick one that's as generic as possible.

Cabarc exe not unzipping when filepath has unicode characters [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I am trying to unzip a file from a source folder whose name is in Unicode(Chinese) using Cabarc.exe utility.
But the utility is not unzipping the same.
If i rename the folder to English, then it works.
Is this a known issue? Any work arounds?
Code: Cabarc.exe -p X "C:\测试\sourcefile.zip" "C:\ProgramData\destination"\
Sounds like a typical non-Unicode ('ANSI') compiled app - in which case there's not really much fix possible, any character used in the command line that is not available in your locale code page will necessarily fail.
Setting your Windows locale to code page 936 ("language for non-Unicode applications" -> Chinese) would allow you to use Chinese characters, but not any other non-Chinese characters that aren't available in that code page.
The command chcp 65001 to set your code page to UTF-8 for a particular session would in theory allow you to use all Unicode characters. Unfortunately there are a number of bugs in the implementation of code page 65001 that cause widespread breakage... I don't know if cabarc would survive it.

Categories

Resources