I'm currently trying to make a minecraft launcher for my server. But some reason it wont start. This is the code I used. Can someone check what I did wrong ?
string installPath = GetJavaInstallationPath();
string filePath = System.IO.Path.Combine(installPath, "bin\\Javaw.exe");
Environment.SetEnvironmentVariable("APPDATA", "C:\\SCO\\");
Process process = new Process();
ProcessStartInfo info = new ProcessStartInfo();
string dir = #"C:\SCO\.minecraft\versions\";
info.FileName = filePath;
info.CreateNoWindow = true;
info.Arguments = "-cp \"" + dir + "1.8.3.jar;" + dir + "lwjgl.jar;" + dir + "lwjgl_util.jar;" + dir + "jinput.jar;\" ";
info.Arguments += "\"-Djava.library.path=" + dir + "natives\" -Xmx1024M -Xms512M net.minecraft.client.main.Main " + username + " " + session;
process.StartInfo = info;
process.Start();
try this code, it worked for me
private void StartMinecraft(string username, string accessToken, string uuid, string gameVersion)
{
ProcessStartInfo minecraft = new ProcessStartInfo
{
FileName = GetJavaInstallationPath() + #"\bin\javaw.exe",
CreateNoWindow = false,
Arguments = " -XX:+UseConcMarkSweepGC -XX:-UseAdaptiveSizePolicy -XX:+CMSParallelRemarkEnabled -XX:+ParallelRefProcEnabled -XX:+CMSClassUnloadingEnabled -XX:+UseCMSInitiatingOccupancyOnly -Xmx1024M -Dfile.encoding=UTF-8 -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Djava.library.path=C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/versions/" + gameVersion + "/natives -Dminecraft.launcher.brand=java-minecraft-launcher -Dminecraft.launcher.version=1.6.84-j -cp C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/oshi-project/oshi-core/1.1/oshi-core-1.1.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/net/java/dev/jna/jna/4.4.0/jna-4.4.0.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/net/java/dev/jna/platform/3.4.0/platform-3.4.0.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/com/ibm/icu/icu4j/66.1/icu4j-66.1.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/com/mojang/javabridge/1.0.22/javabridge-1.0.22.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/net/sf/jopt-simple/jopt-simple/5.0.3/jopt-simple-5.0.3.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/io/netty/netty-all/4.1.25.Final/netty-all-4.1.25.Final.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/com/google/guava/guava/21.0/guava-21.0.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/commons-io/commons-io/2.5/commons-io-2.5.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/commons-codec/commons-codec/1.10/commons-codec-1.10.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/net/java/jinput/jinput/2.0.5/jinput-2.0.5.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/net/java/jutils/jutils/1.0.0/jutils-1.0.0.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/com/mojang/brigadier/1.0.17/brigadier-1.0.17.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/com/mojang/datafixerupper/4.0.26/datafixerupper-4.0.26.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/com/google/code/gson/gson/2.8.0/gson-2.8.0.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/org/apache/httpcomponents/httpclient/4.3.3/httpclient-4.3.3.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/org/apache/httpcomponents/httpcore/4.3.2/httpcore-4.3.2.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/it/unimi/dsi/fastutil/8.2.1/fastutil-8.2.1.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/org/apache/logging/log4j/log4j-api/2.8.1/log4j-api-2.8.1.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/org/apache/logging/log4j/log4j-core/2.8.1/log4j-core-2.8.1.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/org/lwjgl/lwjgl/3.2.2/lwjgl-3.2.2.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/org/lwjgl/lwjgl-jemalloc/3.2.2/lwjgl-jemalloc-3.2.2.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/org/lwjgl/lwjgl-openal/3.2.2/lwjgl-openal-3.2.2.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/org/lwjgl/lwjgl-opengl/3.2.2/lwjgl-opengl-3.2.2.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/org/lwjgl/lwjgl-glfw/3.2.2/lwjgl-glfw-3.2.2.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/org/lwjgl/lwjgl-stb/3.2.2/lwjgl-stb-3.2.2.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/org/lwjgl/lwjgl-tinyfd/3.2.2/lwjgl-tinyfd-3.2.2.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/com/mojang/text2speech/1.11.3/text2speech-1.11.3.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/libraries/by/ely/authlib/2.0.27.4/authlib-2.0.27.4.jar;C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/versions/" + gameVersion + "/" + gameVersion + ".jar net.minecraft.client.main.Main --username " + username + " --version " + gameVersion + " --gameDir C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft --assetsDir C:/Users/" + Environment.UserName + "/AppData/Roaming/.minecraft/assets --assetIndex " + gameVersion + " --uuid " + uuid + " --accessToken " + accessToken + " --userType legacy --versionType release --width 925 --height 530"
};
Process.Start(minecraft);
}
Must try this: info.CreateNoWindow = true; to info.CreateNoWindow = false;
or recheck parameters and must be Java path is valid
Related
I do not receive any errors, the program simply does not execute remotely and I am looking for ideas as to why that may be occurring. The program runs fine locally when I run it from the remote computer using command prompt. The program itself takes 10 arguments, hence args[0] through [9] below. Any suggestions are appreciated.
NOTE: I tested this code using notepad and it worked fine, so it seems to be related to how I am calling my program with arguments (as notepad has no arguments).
Thanks
String programArgs = #"C:\Report\Report.exe " + "\"" + args[0] + "\"" + " " + args[1]
+ " " + args[2] + " " + args[3] + " " + args[4] + " " + args[5] + " " + args[6]
+ " " + "\"" + args[7] + "\"" + " " + args[8] + " " + args[9];
object[] theProcessToRun = { programArgs, #"C:\Report" };
ManagementScope wmiScope = new ManagementScope(#"\\" + hostname + #"\root\cimv2");
wmiScope.Options.Impersonation = ImpersonationLevel.Impersonate;
wmiScope.Connect();
using (ManagementClass managementClass = new ManagementClass(wmiScope,
new ManagementPath("Win32_Process"), new ObjectGetOptions()))
{
managementClass.InvokeMethod("Create", theProcessToRun);
}
This Program I been working on works great except for when a folder name contains any Symbol like "#" or "&" or any other symbol it will create a entirely new folder with a % and some numbers behind it when i open the folder that was already there. But if i delete the Symbol it Works fine.Photo Of The Folders
I don't have any idea why it does it. When i open a folder it will read text files with properties and display them in the text Boxes but if it has a symbol it wont even do that. But If i delete the symbol and not change the property the Properties show the symbol so that is not the problem. If anyone has any idea on why it is doing this or need more information just let me know please.
Thank you
//
//START UP PROCCESS
//
private void JobViewer_Load(object sender, EventArgs e)
{
timer1.Start(); //CLOCK
int BrowserVer, RegVal;
// get the installed IE version
using (WebBrowser Wb = new WebBrowser())
BrowserVer = Wb.Version.Major;
// set the appropriate IE version
if (BrowserVer >= 11)
RegVal = 11001;
else if (BrowserVer == 10)
RegVal = 10001;
else if (BrowserVer == 9)
RegVal = 9999;
else if (BrowserVer == 8)
RegVal = 8888;
else
RegVal = 7000;
// set the actual key
RegistryKey Key = Registry.CurrentUser.OpenSubKey(#"SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", true);
Key.SetValue(System.Diagnostics.Process.GetCurrentProcess().ProcessName + ".exe", RegVal, RegistryValueKind.DWord);
Key.Close();
contextMenuStrip1.Renderer = new ToolStripProfessionalRenderer(new ColorTable());
}
//
//OPEN PERSON'S FILE LOCATION
//
private void FLoc1_Click(object sender, EventArgs e)
{
DisplayJobs.Navigate(#"F:\Internal Jobs\Jobs\Chad");
}
private void FLoc2_Click(object sender, EventArgs e)
{
DisplayJobs.Navigate(#"F:\Internal Jobs\Jobs\Dan");
}
private void FLoc3_Click(object sender, EventArgs e)
{
DisplayJobs.Navigate(#"F:\Internal Jobs\Jobs\Erv");
}
private void FLoc4_Click(object sender, EventArgs e)
{
DisplayJobs.Navigate(#"F:\Internal Jobs\Jobs\Jacob");
}
private void FLoc5_Click(object sender, EventArgs e)
{
DisplayJobs.Navigate(#"F:\Internal Jobs\Jobs\Nate");
}
private void FLoc6_Click(object sender, EventArgs e)
{
DisplayJobs.Navigate(#"F:\Internal Jobs\Jobs\Miller");
}
private void FLoc7_Click(object sender, EventArgs e)
{
DisplayJobs.Navigate(#"F:\Internal Jobs\Jobs\Terry");
}
private void FLoc8_Click(object sender, EventArgs e)
{
DisplayJobs.Navigate(#"F:\Internal Jobs\Jobs\Kelley");
}
private void FLoc9_Click(object sender, EventArgs e)
{
DisplayJobs.Navigate(#"F:\Internal Jobs\Jobs\Jenny");
}
private void DisplayJobs_DocumentCompleted(object sender,
WebBrowserDocumentCompletedEventArgs e)
{
JobPath.Text = DisplayJobs.Url.ToString();
}
private void JobPath_TextChanged(object sender, EventArgs e)
{
textBox1.Text = JobPath.Text.Remove(0, 8);
FilesMade();
try
{
lblContact.Text = File.ReadAllText((#textBox1.Text +
#"\Properties\Contact.txt"));
lblJobName.Text = File.ReadAllText(#textBox1.Text +
#"\Properties\JobName.txt");
lblBidDate.Text = File.ReadAllText(#textBox1.Text +
#"\Properties\BidDate.txt");
lblEngineer.Text = File.ReadAllText(#textBox1.Text +
#"\Properties\Engineer.txt");
lblTakeOff.Text = File.ReadAllText(#textBox1.Text +
#"\Properties\TakeOff.txt");
lblReceived.Text = File.ReadAllText(#textBox1.Text +
#"\Properties\Received.txt");
lblVendor.Text = File.ReadAllText(#textBox1.Text +
#"\Properties\Vendor.txt");
//Specific Person Notes
lblJDNotes.Text = File.ReadAllText(#textBox1.Text +
#"\Properties\Notes\JDNotes.txt");
lblNotes.Text = File.ReadAllText(#textBox1.Text + #"\Properties\Notes\GNotes.txt");
ChadNotes.Text = File.ReadAllText(#textBox1.Text + #"\Properties\Notes\CNotes.txt");
DanNotes.Text = File.ReadAllText(#textBox1.Text + #"\Properties\Notes\DNotes.txt");
ErvNotes.Text = File.ReadAllText(#textBox1.Text + #"\Properties\Notes\ENotes.txt");
NateNotes.Text = File.ReadAllText(#textBox1.Text + #"\Properties\Notes\NNotes.txt");
TerryMNotes.Text = File.ReadAllText(#textBox1.Text + #"\Properties\Notes\TMNotes.txt");
TerrySNotes.Text = File.ReadAllText(#textBox1.Text + #"\Properties\Notes\TSNotes.txt");
KelleyNotes.Text = File.ReadAllText(#textBox1.Text + #"\Properties\Notes\KNotes.txt");
JenNotes.Text = File.ReadAllText(#textBox1.Text + #"\Properties\Notes\JenNotes.txt");
lblPriorApp.Text = File.ReadAllText(#textBox1.Text + #"\Properties\PriorApp.txt");
lblProject.Text = File.ReadAllText(#textBox1.Text + #"\Properties\Project.txt");
lblLocation.Text = File.ReadAllText(#textBox1.Text + #"\Properties\Location.txt");
}
catch
{ }
//Converts The Bid Date To Long Date
try
{
DateTime convertedtime = DateTime.Parse(lblBidDate.Text);
JobName.Text = lblJobName.Text;
JobLocation.Text = lblLocation.Text;
JobBidDate.Text = convertedtime.ToLongDateString();
}
catch { }
if (Directory.Exists(#textBox1.Text + #"\Archive"))
{
JobName.Text = "";
JobLocation.Text = "";
JobBidDate.Text = "";
}
}
private void JLCont_char(object sender, EventArgs e)
{
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
// if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + "
- " + lblJobName.Text))
// btnEdit.Enabled = false;
if (Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - "
+ lblJobName.Text))
NewJob.Enabled = true;
if (Directory.Exists(#textBox1.Text + "\\6-Emails"))
NewJob.Enabled = true;
if (Directory.Exists(#textBox1.Text + "\\6-Emails"))
btnEdit.Enabled = true;
}
//
//CREATE A NEW JOB
//
private wbNewJob wbNwJob = new wbNewJob();
private void NewJob_Click(object sender, EventArgs e)
{
try
{
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text +
" - " + lblJobName.Text))
Directory.CreateDirectory(#textBox1.Text + "\\" +
lblBidDate.Text + " - " + lblJobName.Text);
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\0-Submittals"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\0-Submittals");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\0-Submittals" + "\\Properties"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\0-Submittals" + "\\Properties");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\0-Submittals" + "\\Properties\\Notes"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\0-Submittals" + "\\Properties\\Notes");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\1-Pricing"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\1-Pricing");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\1-Pricing" + "\\Properties"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\1-Pricing" + "\\Properties");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\1-Pricing" + "\\Properties\\Notes"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\1-Pricing" + "\\Properties\\Notes");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\2-Take Off"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\2-Take Off");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\2-Take Off" + "\\Properties"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\2-Take Off" + "\\Properties");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\2-Take Off" + "\\Properties\\Notes"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\2-Take Off" + "\\Properties\\Notes");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\3-Files"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\3-Files");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + #"\\3-Files" + "\\Properties"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + #"\\3-Files" + "\\Properties");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + #"\\3-Files" + "\\Properties\\Notes"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + #"\\3-Files" + "\\Properties\\Notes");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\4-Plans"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\4-Plans");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + #"\\4-Plans" + "\\Properties"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + #"\\4-Plans" + "\\Properties");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + #"\\4-Plans" + "\\Properties\\Notes"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + #"\\4-Plans" + "\\Properties\\Notes");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\5-Specs"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\5-Specs");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + #"\\5-Specs" + "\\Properties"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + #"\\5-Specs" + "\\Properties");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + #"\\5-Specs" + "\\Properties\\Notes"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + #"\\5-Specs" + "\\Properties\\Notes");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\6-Emails"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\6-Emails");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + #"\\6-Emails" + "\\Properties"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + #"\\6-Emails" + "\\Properties");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + #"\\6-Emails" + "\\Properties\\Notes"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + #"\\6-Emails" + "\\Properties\\Notes");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\Properties"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + "\\Properties");
if (!Directory.Exists(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + #"\Properties\Notes"))
Directory.CreateDirectory(#textBox1.Text + "\\" + lblBidDate.Text + " - " + lblJobName.Text + #"\Properties\Notes");
}
catch
{ }
try
{
PriceAllInOnePricingCreate();
ExcelTakeOffCreate();
CapsPricingCreate();
WriteToPropertiesNJ();
WriteToEmailsNJ();
WriteToFilesNJ();
WriteToPlansNJ();
WriteToPricingNJ();
WriteToTakeOffNJ();
WriteToSubmittals();
WriteToSpecsNJ();
}
catch { }
try
{
wbNwJob.Show();
wbNwJob.lblContact.Text = lblContact.Text;
wbNwJob.lblJobName.Text = lblJobName.Text;
wbNwJob.lblLocation.Text = lblLocation.Text;
wbNwJob.lblBidDate.Text = lblBidDate.Text;
wbNwJob.lblEngineer.Text = lblEngineer.Text;
wbNwJob.lblPriorApp.Text = lblPriorApp.Text;
wbNwJob.lblTakeOff.Text = lblTakeOff.Text;
wbNwJob.lblProject.Text = lblProject.Text;
}
catch { }
}
//
//EDIT AN EXISTING JOB
//
private void btnEdit_Click_1(object sender, EventArgs e)
{
try
{
WriteToPropertiesED();
WriteToEmailsED();
WriteToFilesED();
WriteToPlansED();
WriteToPricingED();
WriteToTakeOffED();
WriteToSubmittalsED();
WriteToSpecsED();
}
finally { MessageBox.Show("The Job Has Been Saved"); }
}
I want to fetch history from browser as soon as a web site is loaded in the browser. It should fetch clients' browser info and save it in a database so that admin may check out the website that is frequently opened and can do survey on the data.
System.Web.HttpBrowserCapabilities browser = Request.Browser;
string s = "Browser Capabilities\n"
+ "Type = " + browser.Type + "\n"
+ "Name = " + browser.Browser + "\n"
+ "Version = " + browser.Version + "\n"
+ "Major Version = " + browser.MajorVersion + "\n"
+ "Minor Version = " + browser.MinorVersion + "\n"
+ "Platform = " + browser.Platform + "\n"
+ "Is Beta = " + browser.Beta + "\n"
+ "Is Crawler = " + browser.Crawler + "\n"
+ "Is AOL = " + browser.AOL + "\n"
+ "Is Win16 = " + browser.Win16 + "\n"
+ "Is Win32 = " + browser.Win32 + "\n"
+ "Supports Frames = " + browser.Frames + "\n"
+ "Supports Tables = " + browser.Tables + "\n"
+ "Supports Cookies = " + browser.Cookies + "\n"
+ "Supports VBScript = " + browser.VBScript + "\n"
+ "Supports JavaScript = " +
browser.EcmaScriptVersion.ToString() + "\n"
+ "Supports Java Applets = " + browser.JavaApplets + "\n"
+ "Supports ActiveX Controls = " + browser.ActiveXControls
+ "\n";
Request.Browser is used to identify the browser info . Using this you can get all info of browser
IIS is already storing this information for you. See: http://msdn.microsoft.com/en-us/library/ms525410%28v=vs.90%29.aspx
To make that data useful you will then need to use a Log Analyzer tool.
Google this term for some options to use: iis log analyzer
Is it possible to detect user identity from browser using asp.net/vb.net/c# except IP address. My aim is to detect user visit count regardless of IP address; may be Mac address or etc?
Thanks
You can get more than just user identity from request object
HttpContext context = HttpContext.Current;
string browserInfo =
"RemoteUser=" + context.Request.ServerVariables["REMOTE_USER"] + ";\n"
+ "RemoteHost=" + context.Request.ServerVariables["REMOTE_HOST"] + ";\n"
+ "Type=" + context.Request.Browser.Type + ";\n"
+ "Name=" + context.Request.Browser.Browser + ";\n"
+ "Version=" + context.Request.Browser.Version + ";\n"
+ "MajorVersion=" + context.Request.Browser.MajorVersion + ";\n"
+ "MinorVersion=" + context.Request.Browser.MinorVersion + ";\n"
+ "Platform=" + context.Request.Browser.Platform + ";\n"
+ "SupportsCookies=" + context.Request.Browser.Cookies + ";\n"
+ "SupportsJavaScript=" + context.Request.Browser.EcmaScriptVersion.ToString() + ";\n"
+ "SupportsActiveXControls=" + context.Request.Browser.ActiveXControls + ";\n"
+ "SupportsJavaScriptVersion=" + context.Request.Browser["JavaScriptVersion"] + "\n";
You can access user identity by:
context.Request.ServerVariables["REMOTE_USER"]
or
User.Identity.Name
Im trying to access and extract message from Exchange Server 2003. I need to get them by dates but im having problem with it.
Here's the code lsQuery = "<?xml version=\"1.0\"?>"
+ "<D:searchrequest xmlns:D = \"DAV:\" xmlns:m=\"urn:schemas:httpmail:\">"
+ "<D:sql>SELECT \"urn:schemas:httpmail:hasattachment\", \"DAV:displayname\", "
+ "\"urn:schemas:httpmail:from\", \"urn:schemas:httpmail:subject\", "
+ "\"urn:schemas:httpmail:htmldescription\" FROM \"" + lsRootUri
+ "\" WHERE \"DAV:ishidden\" = false "
+ "AND \"DAV:isfolder\" = false "
+ "AND \"urn:schemas:httpmail:hasattachment\" = true "
+ "AND \"urn:schemas:httpmail:read\" = false "
+ "AND \"urn:schemas:httpmail:date \" \">=\" CAST(\"2009/11/17\" as 'dateTime') "
+ "AND \"urn:schemas:httpmail:date \" \"<=\" CAST(\"2009/11/19\" as 'dateTime') "
+ "</D:sql></D:searchrequest>";
http://msdn.microsoft.com/en-us/library/aa123600%28EXCHG.65%29.aspx