|
Yeah, I like dotPeek, but that "use the source" bit has thrown me a couple of times.
ILSpy is a bit more basic, but sometimes that's exactly what you want.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Quote: a bit more basic, but sometimes that's exactly what you want. We have a special forum for that
|
|
|
|
|
Nobody really wants VB!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
An Assert should never modify data
|
|
|
|
|
private void timer1_Tick(object sender, EventArgs e)
{
…………….
string s0 = string.Concat(hmI7Segment1.TagName); // got result like this Channel1.DV1.DB1.Level1. but actually data or value of hmI7Segment1 = 8835, this value will increment based on timer1_tick.
Please help me, what should I do to get the value of string hmI7Segment1.TagName?
}
|
|
|
|
|
This is the same question as the one you posted two days ago, but with the addition of a Timer.Tick handler declaration - so the answer doesn't change from what you were told last time.
Do yourself a favour: start with the debugger and find out exactly what is in hmI7Segment1.TagName as it's not at all clear from that what you are working with. If it's a string "8835" then it's trivial: int.TryParse would do it. But if it's a string "Channel1.DV1.DB1.Level1" then everything I said before is still relevant.
We can't debug this for you - we don't have any access to your code while it's running, and it needs that.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
using var client = new WebClient();
client.DownloadFileAsync(new Uri("https://speed.hetzner.de/10GB.bin"), "10GB.bin");
All I want is, when another user connects to the modem / router via wifi and starts listening music on Spotify or another usages, which need bandwidth, the method DownloadFileAsync decreases download speed until he/she is using bandwidth and increase it again when nobody is using bandwidth for a period.
|
|
|
|
|
What you are looking at utilizing is bandwidth throttling. This is not something you are going to be easily able to accomplish using DownloadFileAsync. If I were you, I would look at an article like this[^] instead.
|
|
|
|
|
I've read about bandwidth throttling, but main problem is that how can I detect internet usage to applying bandwidth throttling?
|
|
|
|
|
Songs are small enough, I don't think it matters (< 3 MB). The Media Element can be "paused", whether it downloads everything first, I don't know. If your queueing more than 1 file for 1 person, then don't.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Song was just a sample. I want to build a new download manager, so that whenever a user on the LAN or connected via wifi wants to open web page, watch a film on YouTube or gaming online, my download manager decrease download speed automatically.
|
|
|
|
|
Have you thought about applying QoS rules on the network (router)?
Director of Transmogrification Services
Shinobi of Query Language
Master of Yoda Conditional
|
|
|
|
|
No, because some modem doesn't have QoS. I'm developing a new download manager and I want to decrease download speed whenever user starts using internet for opening website, listening music on spotify, gaming online or any other usages.
|
|
|
|
|
I was thinking on the lines of implementing it at the network level and not on the individual machines. Would seem to be a lot simpler to implement and would not be adding further load on your WiFi bandwidth
Director of Transmogrification Services
Shinobi of Query Language
Master of Yoda Conditional
|
|
|
|
|
We don't have any access to Modem/Router's config and also All modems doesn't have QoS settings.
modified 9-Feb-20 2:40am.
|
|
|
|
|
Also, I'm a developer and here is CodeProject not Superuser. I want to make application for my users not changing QoS setting for my uses.
|
|
|
|
|
Sometimes you need to step back and look at the big picture; if you are having a problem with bandwidth it does not make sense to me to add to the network load in an attempt to regulate it.
And the correct spot would more likely be ServerFault
Director of Transmogrification Services
Shinobi of Query Language
Master of Yoda Conditional
|
|
|
|
|
I want call dll functions in thread and it uses handle object for parameter.
If I call dll functions directly, then there is no problem.
But if I call it via thread, then runtime error occurs.
I think it will be because of handle object, so I have saved handle before start thread to static variable and use this value in thread.
But the problem is same.
Please help me.
|
|
|
|
|
All functions are called via a thread: a Thread is the basic unit of execution for an app and if you don't have a running thread, you don't have running code. Initially, your code will have a single running thread, and when they stops executing your app is closed - but you can add threads to do long running functionality without affecting the user display, or to increase the parallelism of your processing. In broad principle, there is no difference between the original thread and any you add, except in .NET only the thread that created Controls can access them.
But ... your use of "handles" implies you are actually not working in C#, but in C or C++ so you would need to ask this in a different forum.
Either way, you'd need to give us a much better explanation of what you are doing and how it is going wrong that you have: Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
What runtime error are you seeing? Without this basic piece of information, any help will be guesswork at best.
|
|
|
|
|
What do your "calls" look like? You're implying you have 2 different ones.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Today, out of nowhere, I started getting this error when I run my app
System.ComponentModel.Composition.ImportCardinalityMismatchException: No exports were found that match the constraint:
ContractName Views.MainWindow
RequiredTypeIdentity Views.MainWindow
I have made NO code changes. One minute it was running fine, the next - bam! error.
ALl of the Google search hits I found talk about some kind of Visual Studio problem, but this only happens when I RUN my app, not open it. And, the message sure smells like EntityFramework, which we're using.
The message mentions "ImportCardinalityMismatchException". Never seen this before.
I following the instructions in this SO post, I repaired VS, rebooted, and all that.
Anyone have any thoughts on this?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Google points to MEF, not EF.
Kevin Marois wrote: this only happens when I RUN my app, not open it Any plugins loaded when the app runs?
c# - MEF composition import issue when using specific interface - Stack Overflow[^]
..and unless you have a hash from all libraries that your code uses, it is hard to prove that "nothing changed".
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Ya I meant MEF not EF
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
So you're using MEF?
Did it "stop working" at the exact same time on other machines? Do you have yesterdays backup that you can try in a VM?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|