|
If you ask for the name of an item then you will get it in the local language. You could try setting the default culture to English in order to get the name you expect. But a better idea is not to try and get names and compare them to strings, but to check the type of the item as described at FolderItem object (Windows)[^].
However, I may have misunderstood your question as it is not exactly clear what you are trying to achieve.
|
|
|
|
|
Are you sure that any Windows version is equipped to switch to any culture? Or am I doing it wrong? I try:
CultureInfo culture = CultureInfo.CreateSpecificCulture("fr-FR");
CultureInfo.DefaultThreadCurrentCulture = culture;
Thread.CurrentThread.CurrentCulture = culture;
attrnames = new string[400];
Folder rFolder = GetShell32NameSpaceFolder(_sysRoot);
for (int attrNo = 1; attrNo < 400; attrNo++) {
string attrName = rFolder.GetDetailsOf(0, attrNo).Trim();
attrnames[attrNo] = attrName.Empty() ? null : attrName;
}
- as you can see, I both set DetfaultThreadCurrentCulture and CurrentThread.CurrentCulture. The table is still filled with English attribute names, rather than French. I sort of doubt that any Windows installation can take on any culture from any place in the world - it may be possible to install it, but it is not necessarily install it.
My immediate need right now is when I have detected that a file is a symlink / junction, to know programmatically what the link refers to. If in Windows Explorer display the Properties of the file, it comes up as "Target:" in the "Shortcut" tab. In my current Win10 version, I can obtain the target path by
GetDetailsOf(196, );
- I find "Link target" in element 196 of the above table. In other Windows versions, the index is different, so I initialize the table at startup and search for the string "Link target" when I need to look up that attribute number.
I have not found any alternative way to get hold of the link target. (I could use a command shell, giving a dir command and parse the output - but what are the commands, and what shoult I look for, in a Polish language command shell?)
Later, I will make use of more of the attributes not available through the basic attributes, such as the media description attributes (e.g. Duration, Frame width, Frame rate, ...) or author info. If there is another (language/version independent) way of obtaining the target of a symbolic link, I would be helped in the short term, but in the long term, I would need programmatic access to a whole lot of these attributes, preferably all those that can be displayed as an Explorer column.
This information is saved in the file system. I would be extremely surprised if each attribute value is tagged with a language specific attribute name. I would also be surprised if they are tagged with the index I see and use through GetDetailsOf - then, any Windows update would require a re-tagging of every file on every disk, and I couldn't take that disk over to an older version OS without loosing the attributes. Which identification mechanism is used in the NTFS metadata to recognize, say, the link target, or the video frame rate? Is there any way I can ask by the same ID that is used internally within the NTFS file system?
|
|
|
|
|
You can refereto the link in my previous message to see how to test for a link. See Reparse Points (Windows)[^] for information about junctions.
|
|
|
|
|
It seems as if DeviceIoControl has not yet been wrapped up for C# access. While I certainly could spend the resources doing that, it certainly will be very much a short-term solution, solving only one of my needs. As I wrote in my previous post, I will need acess to a bunch of these attributes, and the other ones are not available through DeviceIoControl. The effort spent for solving a fraction of the problem is wasted when I find a more complete solution.
If I ask those Polish guys what "Link target" is in Polish, I can solve my immediate problem with a small fraction of the effort of learning the intricasies of DeviceIoControl and making a C# interface to it. (I did program IOCTL in the old DOS days, and I am convinced that this modern variant is no less complex when I start digging into it.)
|
|
|
|
|
Without knowing all the details, my impulse is to use an optional translation table.
If there is an entry in the "table" for a given word, use the "other" word to do the lookup, etc.
The table either exists or does not exist. If it does exist, it has one or more entries.
Note that nothing was said about a given "language".
The table could even be "user maintained" locally.
(I used a "translation" table once to confuse normal system commands (an Amdahl engineer joke)).
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Hi Programmers,
Have you ever practiced coding online to prepare a technical interview or to groom your skills? If yes, how well it was? Which websites have you used? And, how effective they were? If possible, share the challenges you have faced?
|
|
|
|
|
Websites can offer you the basics but you need experience for most interviews, as you never know what real life question may be thrown at you.
|
|
|
|
|
|
I have seen pointless questions about very specific api things. For example a number of people want to discuss Big O notation in regards to specific collections. Pointless because it just doesn't reflect anything about normal current business programming.
You can find example interview questions and then do them, since you might get lucky and have them ask you that same question. Because they might have done exactly the same query.
|
|
|
|
|
Kindly reply to my mail box vinothsrivi@gmail.com if u could educate me on .net core with microservices and sql server with MSBI and azure deployment with one-one in online.
|
|
|
|
|
|
You forgot to tell people how much you are willing to pay for tutoring or were you expecting that we'd do it for free?
This space for rent
|
|
|
|
|
Hi Pete O'Hanlon
Thanks for the response I did not said that I am looking this with free of cost. I just want to see how the tutor can capable of delivering the contents with one demo. Then if is really satisfiable then I am ready to pay our market fee.
|
|
|
|
|
Yeah, your naivety is cute. That's not going to happen, anywhere.
You're simply not going to get a CUSTOM BUILT, just for you, series of training classes over the web for free., not even a SINGLE "try before you buy" session.
You're talking about over a hundred hours of instruction based on the topics you posted, and that's only going to scratch the surface of everything.
System.ItDidntWorkException: Something didn't work as expected.
C# - How to debug code[ ^].
Seriously, go read these articles.
Dave Kreskowiak
|
|
|
|
|
It would be best if you didn't post your email address is a public forum. The only people who care about it, or are going to ever use it, are spammers. Yes, they have bots that scan forums for anything that looks like an email address and adds it to their databases to throw tons of "male enhancement" spam at you.
System.ItDidntWorkException: Something didn't work as expected.
C# - How to debug code[ ^].
Seriously, go read these articles.
Dave Kreskowiak
|
|
|
|
|
How can i reverse this function so when i pass the output i get back the input
Dim text2 As String = ""
Dim num As Integer = 1
Dim num2 As Integer
Dim num3 As Integer
Do
' The following expression was wrapped in a unchecked-expression
Dim value As Integer = CInt(Math.Round(Math.Floor(CDbl((10.0F * VBMath.Rnd())))))
text2 += Conversions.ToString(value)
num += 1
num2 = num
num3 = 8
Loop While num2 <= num3
|
|
|
|
|
You can only do so if you know what sequence the VBMath.Rnd()[^] function returns. That's something the function is not guaranteed to do, so you can't.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
You can't reverse that function. Round and Floor are "lossy", meaning bits of data are lost when the functions are used on the data. It's impossible to get that data back and get the original number.
System.ItDidntWorkException: Something didn't work as expected.
C# - How to debug code[ ^].
Seriously, go read these articles.
Dave Kreskowiak
|
|
|
|
|
Hi there,
(Not sure which area to put this question in so forgive me)I have a word document but i'd like to convert it to HTML. I know i can convert from Microsoft Word to HTML document but are there any limitations or issues? if so what do i need to be aware of?
Can anyone suggest any suitable alternatives please?
|
|
|
|
|
Yeah, the limitations of HTML. Word can format individual elements of the document in ways that are not directly supported by HTML. You'll get a good approximation of the document, but the more complex the document, the more differences you're going to see.
The alternative is to "print" the document to a PDF file and send that to the client. If the browser has an extension to display PDF documents in the browser it'll display. If not, they'll get a prompt to open it in an external viewer or save the file.
System.ItDidntWorkException: Something didn't work as expected.
C# - How to debug code[ ^].
Seriously, go read these articles.
Dave Kreskowiak
|
|
|
|
|
I have an eight core computer and therefor I can have a tasklist with 8 tasks.
But not al 8 task are perform correctly or something else doesn't work.
My objective: I want 8 count results be shown on a website (MVC) so I have 8 different methods that get the 8 result seperatly.
One method is like this:
protected void GetArticleCount()
{
ArticlesManager articlesManager = new ArticlesManager();
ViewBag.ArticlesCount = articlesManager.ArticleCount();
}
And so there are 7 more.
My code to collect all 8 is like this:
var t1 = Task.Factory.StartNew(() => GetArticleCount());
var t2 = Task.Factory.StartNew(() => GetBrancheCount());
var t3 = Task.Factory.StartNew(() => GetCompaniesCount());
var t4 = Task.Factory.StartNew(() => GetDeliveriesCount());
var t5 = Task.Factory.StartNew(() => GetDistributionCentresCount());
var t6 = Task.Factory.StartNew(() => GetDocksCount());
var t7 = Task.Factory.StartNew(() => GetInvoicesCount());
var t8 = Task.Factory.StartNew(() => GetOrdersCount());
var taskList = new List<Task> { t1, t2, t3, t4, t5, t6, t7, t8 };
Task.WaitAll(taskList.ToArray());
When I run it 5 off the 8 are visible on my website and the remaining 3 are also shown after a refresh (F5).
When I run the code without the "Task.Factory" but sequentially, all 8 are shown immediately.
Question: why? What's wrong with my code?
|
|
|
|
|
Nothing is wrong. But you need to understand that starting a new task does not automatically start it immediately in a new core. The operating system queues tasks for processing them and starts them when resources are available.
|
|
|
|
|
Okay, so this is a "problem" because it does not give the result I want.
Thanks for your reply, I know what to do.
|
|
|
|
|
"Refresh rate" is not necessarrily tied to when your tasks are finishing.
I would use something "other" to determine when tasks actually finish than when it "shows up".
Your "tasks" look like queries; some will probably always run last. You should see a pattern.
Even too many (redundant) refreshes can affect overall performance (flicker; bouncing cursor).
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
You are completely right Gerry 
|
|
|
|