16,016,643 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Ammar_Ahmad (Top 13 by date)
Ammar_Ahmad
10-May-14 5:09am
View
@Richard MacCutchan:
Seems like it wasn't, I have changed the code to:
<pre>System.Diagnostics.Process.Start("C:\Program Files\Java\jre8\bin\javaw.exe", "Launch")</pre>
which runs fine. Is there a way I can make the set java command in the environment path so that I can directly use?
<pre>System.Diagnostics.Process.Start("javaw", "Launch")</pre>
without hardcoded paths.
Ammar_Ahmad
9-Jan-14 17:37pm
View
Thanks :D that helped a lot :D
Ammar_Ahmad
9-Jan-14 17:22pm
View
Thanks for the fast reply but now I am in another issue. I have a breakpoint in the procedure so I can see exactly how the values in variable are. It seems like the value is never reached. Here is the result:
http://imgur.com/4vGgJ1g
Ammar_Ahmad
4-Jan-14 8:11am
View
Hi, sorry for the late reply... I would love to see your suggestions too :D
And btw happy new year :)
Ammar_Ahmad
21-Nov-13 15:06pm
View
Thanks for the quick reply. Also thanks for the tip regarding the encryption. :)
Ammar_Ahmad
8-Sep-13 7:37am
View
Actually that worked :D thanks for the tip. Too bad they don't teach these sort of stuff in school D:
Here is the code in case anyone else wanted to do this:
#include <iostream>
#include <stdio.h>
#include <string>
using namespace std;
int main()
{
int aCount = 0, bCount = 0, cCount = 0, fCount = 0;
int name = 0;
int name2 = 0;
string one = "";
printf("Enter your grade: ");
scanf("%d",&name);
if (name >=90)
{
// one = one + "A";
name2 = 1;
switch( name2 ) {
case 1:
++aCount;
break;
}
}
else if (name >= 80)
{
// one = one + "B";
name2 = 2;
switch( name2 ) {
case 2:
++bCount;
break;
}
}
else if (name >=70)
{
name2 = 3;
// one = one + "C";
switch( name2 ) {
case 3:
++cCount;
break;
}
}
else if (name <=69)
{
name2 = 4;
switch( name2 ) {
case 4:
++fCount;
break;
// one = one + "F";
}
}
printf("%d", name2);
//----------------------------------------------
printf( "A: %d\n", aCount );
printf( "B: %d\n", bCount );
printf( "C: %d\n", cCount );
printf( "F: %d\n", fCount );
getchar();
getchar();
return 0;
}
Ammar_Ahmad
8-Sep-13 7:28am
View
I have done it using if else if before but I am required to do this using the case switch. Which I am unable to understand how to do.. Any suggestion on how to use it in switch case would be great.
Ammar_Ahmad
8-Sep-13 7:10am
View
That didn't work D:
But Ive found something interesting.
scanf("%d",&name);
if (name >=90)
{
// one = one + "A";
name2 = 1;
}
else if (name >= 80)
{
// one = one + "B";
name2 = 2;
}
else if (name >=70)
{
// one = one + "C";
name2 = 3;
}
else if (name <=69)
{
// one = one + "F";
name2 = 4;
}
printf("%d", &name2);
putting printf("%d", &name2); and giving it any input gives me a value: 2293576. Not sure why it is not giving that. When it should be giving me 1 or 2 or 3 or 4 in that variable.
Ammar_Ahmad
5-Sep-13 4:30am
View
Thanks for the quick reply :)
Ammar_Ahmad
4-Jul-13 18:49pm
View
Actually just tested this on my friends computer. He has 32 bit and it works like a charm :D
Thanks!
Ammar_Ahmad
4-Jul-13 17:51pm
View
Alright this is what I got so far. It works fine on my 64 bit machine but I don't really have any 32 bit to test this on.. Will this also work on 32 bit:
Sub StartupLauncher()
Dim q As String
q = Form1.TextBox2.Text
Dim appData As String = q + Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/.minecraft/" + q
Dim retValue As Boolean
Dim pInfo As PROCESS_INFORMATION = New PROCESS_INFORMATION()
Dim sInfo As STARTUPINFO = New STARTUPINFO()
retValue = CreateProcess(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + "\Java\jre7\bin\javaw.exe", "-Xmx512m -Djava.library.path=" + appData + "versions\1.6.1\1.6.1_TagCraftMC -cp " + appData + "libraries\net\sf\jopt-simple\jopt-simple\4.5\jopt-simple-4.5.jar;" + appData + "libraries\com\paulscode\codecjorbis\20101023\codecjorbis-20101023.jar;" + appData + "libraries\com\paulscode\codecwav\20101023\codecwav-20101023.jar;" + appData + "libraries\com\paulscode\libraryjavasound\20101123\libraryjavasound-20101123.jar;" + appData + "libraries\com\paulscode\librarylwjglopenal\20100824\librarylwjglopenal-20100824.jar;" + appData + "libraries\com\paulscode\soundsystem\20120107\soundsystem-20120107.jar;" + appData + "libraries\org\lwjgl\lwjgl\lwjgl\2.9.0\lwjgl-2.9.0.jar;" + appData + "libraries\org\lwjgl\lwjgl\lwjgl_util\2.9.0\lwjgl_util-2.9.0.jar;" + appData + "libraries\argo\argo\2.25_fixed\argo-2.25_fixed.jar;" + appData + "libraries\org\bouncycastle\bcprov-jdk15on\1.47\bcprov-jdk15on-1.47.jar;" + appData + "libraries\com\google\guava\guava\14.0\guava-14.0.jar;" + appData + "libraries\org\apache\commons\commons-lang3\3.1\commons-lang3-3.1.jar;" + appData + "libraries\commons-io\commons-io\2.4\commons-io-2.4.jar;" + appData + "libraries\net\java\jinput\jinput\2.0.5\jinput-2.0.5.jar;" + appData + "libraries\net\java\jutils\jutils\1.0.0\jutils-1.0.0.jar;" + appData + "libraries\com\google\code\gson\gson\2.2.2\gson-2.2.2.jar;" + appData + "versions\1.6.1\1.6.1.jar net.minecraft.client.main.Main --username " + Form1.TextBox1.Text + " --session -0 --version 1.6.1 --gameDir" + q + Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/.minecraft" + q + " --assetsDir " + appData + "assets", IntPtr.Zero, IntPtr.Zero, False, 0, IntPtr.Zero, Nothing, sInfo, pInfo)
End Sub
I have added this in a separate class file.
Ammar_Ahmad
4-Jul-13 13:20pm
View
Well the length of the arguments and the length of the full path does exceed 2080. Is there a way I can make it work?
Here is the code I am using:
<pre lang="vb">Dim appData As String = q + Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/.minecraft/" + q
Dim process As New Process
Dim info As New ProcessStartInfo
'info.FileName = "javaw"
info.FileName = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + "\Java\jre7\bin\javaw.exe"
info.CreateNoWindow = True
info.Arguments = "-Xmx512m -Djava.library.path=" + appData + "versions\1.6.1\1.6.1_TagCraftMC -cp " + appData + "libraries\net\sf\jopt-simple\jopt-simple\4.5\jopt-simple-4.5.jar;" + appData + "libraries\com\paulscode\codecjorbis\20101023\codecjorbis-20101023.jar;" + appData + "libraries\com\paulscode\codecwav\20101023\codecwav-20101023.jar;" + appData + "libraries\com\paulscode\libraryjavasound\20101123\libraryjavasound-20101123.jar;" + appData + "libraries\com\paulscode\librarylwjglopenal\20100824\librarylwjglopenal-20100824.jar;" + appData + "libraries\com\paulscode\soundsystem\20120107\soundsystem-20120107.jar;" + appData + "libraries\org\lwjgl\lwjgl\lwjgl\2.9.0\lwjgl-2.9.0.jar;" + appData + "libraries\org\lwjgl\lwjgl\lwjgl_util\2.9.0\lwjgl_util-2.9.0.jar;" + appData + "libraries\argo\argo\2.25_fixed\argo-2.25_fixed.jar;" + appData + "libraries\org\bouncycastle\bcprov-jdk15on\1.47\bcprov-jdk15on-1.47.jar;" + appData + "libraries\com\google\guava\guava\14.0\guava-14.0.jar;" + appData + "libraries\org\apache\commons\commons-lang3\3.1\commons-lang3-3.1.jar;" + appData + "libraries\commons-io\commons-io\2.4\commons-io-2.4.jar;" + appData + "libraries\net\java\jinput\jinput\2.0.5\jinput-2.0.5.jar;" + appData + "libraries\net\java\jutils\jutils\1.0.0\jutils-1.0.0.jar;" + appData + "libraries\com\google\code\gson\gson\2.2.2\gson-2.2.2.jar;" + appData + "versions\1.6.1\1.6.1.jar net.minecraft.client.main.Main --username " + TextBox1.Text + " --session -0 --version 1.6.1 --gameDir" + q + Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/.minecraft" + q + " --assetsDir " + appData + "assets"
'-Xms" + MiniRam[MiniRamCMBO.SelectedIndex] + " -Xmx" + MaxRam[MaxiRamCMBO.SelectedIndex] + " "
process.StartInfo = info
process.Start()</pre>
Ammar_Ahmad
2-Jun-12 0:18am
View
Sorry I wasn't aware of that. Thanks for the help :)
Show More