|
thank you so much sir for sharing right query with me 
|
|
|
|
|
Hi friends,
I need good graphic library for C# ,is it available like QCustomPlot
|
|
|
|
|
I've searched everywhere and found in VB, but it does not work.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim aakam031 As String = My.Computer.FileSystem.SpecialDirectories.Temp
Dim akam As String = aakam031 + "filename pashgr"
IO.File.WriteAllBytes(akam, My.Resources.file name)
Process.Start(akam)
End Sub
End Class
Anyone know how to do it in C # 
modified 17-Jan-18 20:51pm.
|
|
|
|
|
Quote: it does not work. This is not a helpful error summary, - it tells us nothing bout what the problem is. All is says is "I have a problem" - but we know that already because you are asking a question!
The other things that don't help are:
1) Showing code that you didn't try - because VB code won't compile in a C# program we have no idea what actual code you did try
2) Not explaining what the code is meant to do: I have no idea what "open a flush" is supposed to mean!
So show us the code you tried; tell us what happened that you didn't expect, or didn't happen that you did; tell us what you did to cause that to happen; explain what you expected the code to do; Tell us what you tried to find out why it did what ti did. Have you used the debugger? If not, why not? If so, what did it show?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
So this code is to run a program that i, we carry inside the project, in that resource folder.
but he is like you and I want him as C # I put it to convert more it does not work
And it's not flush, the broker showed it wrong, I meant program or file
|
|
|
|
|
|
|
And how would you do that? you can leave a sample code or sample link
|
|
|
|
|
see my sample code
public class PersonalDetail
{
public int Id { get; set; }
public string FirstName { get; set; }
public int Age { get; set; }
}
public ActionResult Index()
{
List<PersonalDetail> oPersonalDetail = new List<PersonalDetail>
{
new PersonalDetail {FirstName="Tapan",Age=11},
new PersonalDetail {FirstName="Joy",Age=21},
new PersonalDetail {FirstName="Madhu",Age=31}
};
return View();
}
when oPersonalDetail is populate then i want id should be populate automatically with 1,2,3....son on. so please guide me how could i achieve it ?
|
|
|
|
|
Assuming this is a one-time value (i.e. your data isn't persisted in a database or similar), add a class level static integer to your class, and initialize it to one:
private static int nextValue = 1; Then in your class constructor, you set the Id value to the static variable, and increment:
public PersonalDetail()
{
Id = nextValue++;
} Do note that this is not inherently thread safe, so if you need a complex program you need to look at more robust schemes - but then you are probably going to be using a database of some form to store your data instead of hardcoding it, and all databases provide mechanisms for supporting unique values for each row so that should be a concern.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You have to:
- Add a
static private member variable that holds the last assigned ID
- Provide a constructor that increments the last ID and assigns the value to
Id
- Make the incrementing and copying of the last ID member thread safe (e.g. using
Interlocked.Increment )
- Make the set method for
Id private
Possible implementations are shown in this SO thread: C# Class Auto increment ID - Stack Overflow[^]
|
|
|
|
|
If your data is going to be saved to a database, the chosen database system software can automatically assign id's / sequence numbers for you. The id is assigned when the data is added to the database.
Otherwise, any "ascending" / unique number usually will do; like a timestamp (e.g. machine + yyyymmddhh.....)
Managing "sequence numbers" yourself is usually more pain than it's worth. e.g. Running the same software on different computers usually creates "duplicates" "across" systems.
Always consider the long-term.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Until we understand your intent better, particularly why you used the reserved word 'Index ... and the unexplained method result 'ActionResult, and how 'View is a return value for the method ... well, we are not psychics.
So, clarify what you are trying to do.
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
|
|
|
|
|
my intention is not to mention id value when populate my class and id value will be generated automatically and incremented by 1 always. thanks
|
|
|
|
|
The context is what matters here: depending on context I might:
1. if the value of 'Id is local to the class, then a static class Int32 variable incremented in the constructor is all you need.
1.a. if you need to keep a collection of instances of 'PersonalDetail:
public class PersonalDetail
{
public PersonalDetail(string firstName, int age)
{
if (IdToInstance.Any(kvp => kvp.Value.FirstName.Equals(firstName)))
{
throw new DuplicateNameException();
}
FirstName = firstName;
Age = age;
IdToInstance.Add(Id++, this);
}
public string FirstName { get; set; }
public int Age { get; set; }
static PersonalDetail()
{
Id = 1;
IdToInstance = new Dictionary<int, PersonalDetail>();
}
static int Id { set; get; }
static Dictionary<int, PersonalDetail> IdToInstance { get; }
public static void Add(params (string name, int age)[] pds)
{
foreach (var pd in pds)
{
new PersonalDetail(pd.name, pd.age);
}
}
public static PersonalDetail InstanceFromId(int id)
{
PersonalDetail pd = null;
return IdToInstance.TryGetValue(id, out pd) ? pd : null;
}
}
2. if 'Id is also used by other classes, or can be changed for a given instance: for that, I would consider a static Id manager class.
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
|
|
|
|
|
I'm creating a tool for android, where I would like to create a button that would run the adb or fastboot command and display it on the console.
Most do not know how to import the files into the program and be executed by it, not in having to export the files somewhere to run.
Can you do that?
Another question is how do I download and install a direct program from the site?
the program would be java
Here I have an image as the tool would be
<a href="https://prnt.sc/i1i7y8">Screenshot_1</a>
|
|
|
|
|
Your question is not clear. These commands are part of the Android SDK and run on the PC not the Android device.
Member 13621117 wrote: how do I download and install a direct program from the site? What site are you talking about here?
|
|
|
|
|
So, I have a folder where it contains the files adb.exe, fastboot, logo, recovery ...
I want to know how to direct the commands using this folder.
example: in this folder, you have the file "LOGO.BIN" and need to push to the cell phone using this command "Fastboot flash logo logo.bin"
<pre>
OpenFileDialog openfile = new OpenFileDialog();
openfile.Filter = "IMG files|*.img";
openfile.Title = "Open a file..";
if (openfile.ShowDialog() == DialogResult.OK)
{
flashrecoveryTextbox.Text = openfile.FileName;
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.FileName = "fastboot.exe";
startInfo.Arguments = " flash logo.bin\"" + openfile.FileName + "\"";
process.StartInfo = startInfo;
process.Start();
Console.Text = Console.Text + process.StandardOutput.ReadToEnd();
}
how do I download and install a direct program from the site?
The site would be java using this link:
http://javadl.oracle.com/webapps/download/AutoDL?BundleId=230511_2f38c3b165be4555a1fa6e98c45e0808808
to download the new version of it and shows in the console
|
|
|
|
|
Member 13621117 wrote: how do I download and install a direct program from the site? I may be wrong but isn't that subverting the whole app-store model? I'm pretty sure that, unless you've rooted your device, there will be safeguards in place to prevent you from downloading and executing programs from potentially malicious sources.
This space for rent
|
|
|
|
|
You need to give the full pathname of fastboot in your startInfo.FileName . I have no idea what that link is supposed to represent, but if it is to download a file then you should do that manually. Alternatively you can use the WebRequest/WebResponse classes.
|
|
|
|
|
You're not understanding, especially as I'm using the translator.
My first doubt was how to run direct adb command from the console of my project I'm doing in visual studio in C #
in it will have 2 buttons, one to install the java drive so it needed to download directly from the site. java.com
the other button would only run the adb command, as if it were using the command prompt.
|
|
|
|
|
I have done a project that uses the stream class when I call the Position attribute, the error "Object reference not set to an instance of an object", I have done everything but can not fix this error, You help me to fix it. Thank you very much
Cộng đồng C Việt[^]
|
|
|
|
|
This is one of the most common problems we get asked, and it's also the one we are least equipped to answer, but you are most equipped to answer yourself.
Let me just explain what the error means: You have tried to use a variable, property, or a method return value but it contains null - which means that there is no instance of a class in the variable.
It's a bit like a pocket: you have a pocket in your shirt, which you use to hold a pen. If you reach into the pocket and find there isn't a pen there, you can't sign your name on a piece of paper - and you will get very funny looks if you try! The empty pocket is giving you a null value (no pen here!) so you can't do anything that you would normally do once you retrieved your pen. Why is it empty? That's the question - it may be that you forgot to pick up your pen when you left the house this morning, or possibly you left the pen in the pocket of yesterdays shirt when you took it off last night.
We can't tell, because we weren't there, and even more importantly, we can't even see your shirt, much less what is in the pocket!
Back to computers, and you have done the same thing, somehow - and we can't see your code, much less run it and find out what contains null when it shouldn't.
But you can - and Visual Studio will help you here. Run your program in the debugger and when it fails, VS will show you the line it found the problem on. You can then start looking at the various parts of it to see what value is null and start looking back through your code to find out why. So put a breakpoint at the beginning of the method containing the error line, and run your program from the start again. This time, VS will stop before the error, and let you examine what is going on by stepping through the code looking at your values.
But we can't do that - we don't have your code, we don't know how to use it if we did have it, we don't have your data. So try it - and see how much information you can find out!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
here's my project
[^]
you try to help me. thanks
|
|
|
|
|
That's not the way this works. Griff has told you what the problem is, it's up to you to find out where the problem is. Fortunately for you, if you run your application inside Visual Studio, it will tell you which class and line the problem is. The application will crash at this point and the details will be written to the Output window. Go to that class, add some breakpoints and debug your code. This is your responsibility, not ours.
This space for rent
|
|
|
|