|
Lol
|
|
|
|
|
From the code you posted and the error you say you are getting, I think your brackets are off. You should have { } wrapped around your class methods (Main and ConvertTime) and also to enclose them.
|
|
|
|
|
Thanks, that's what I needed, another pair of eyes. I must have deleted a bracket accidentally. Runs fine now.
|
|
|
|
|
I am a beginner at C# and have been given an assignment that I am having trouble starting. Any help would be useful! Here is the project:
Write a program to print all combinations of hours, minutes and seconds in military time format HH:MM:SS using nested loops.
Like I said, I'm new to this, only 2 weeks in... so keep that in mind!
Thanks,
Bonnie
|
|
|
|
|
It often helps very much when trying to get help with homework assignments if you show what you have come up with so far.
Do you know what nested loops means? Have you given that a try, and if so how far did you get?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
the problem is, with all those nested loops, the app is taking all day.
|
|
|
|
|
Groan.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Nested loops, yes. You'd need 3.
Choosing the bounds of these loops is trivial.
As to outputting, where do you want them to go?
System.Console.WriteLine("{0}:{1}:{2}", h, m, s);
(warning: untested)
Seems reasonable to me.
|
|
|
|
|
It's almost as if the answer is written in your question. If only a certain part were written in all lower case and there was a DateTime object that supported addition your problem would be solved.
|
|
|
|
|
Hi All,
I'm developing a software for geostatistical modeling, and I need to visualize 3d spatial data and doing some basic 3d actions e.g rotation, zoom, slicing, color mapping, gridding and so on. What is the best way for doing this? Shall I use a 3rd party control?
|
|
|
|
|
Couldn't you just use OpenGL?
|
|
|
|
|
I'm not familiar with openGL. which one is prefered, OpenGL or DirectX?
|
|
|
|
|
OpenGL, for several reasons - I'll just list a few:
* easy to use inside winforms (even in C#, check the TAO framework)
* if you manage to crash it, windows will still be alive
* easier low-level manipulation of eg vertices (good for visualization)
* full access to all hardware features (the gpu manufacturer will make sure of it)
DirectX isn't "bad" for 3D visualization though, it's fine to use it.
|
|
|
|
|
Is there any free openGl control implementing basic actions for .NET or I have to design one by myself?
|
|
|
|
|
The TAO framework has one
|
|
|
|
|
Hello,
I have created a datagridview using C# windows application and I am having formatting issues with the data once the datagridview has been populated. The way I have this set up is before I bind the data to the binding source I add a new row which contains combo boxes. These Como boxes are used to populate the new headers. Once the headers have been modified the data needs to be formatted to data types the system can handle. For example, the datagridview populates dates as mm/dd/yyyy 00.00.00 AM but I need to reformat this to mm/dd/yyyy. I have created a method that loops through each cell in the first row and captures the new header (which works) but when the code that is suppose to reformat the column runs, it doesn't work. the code I have to reformat the columns based on the logic used is dataGridView1.Columns[c].DefaultCellStyle.Format = "d";. However, this doesn't work. Can someone please help me? It is much appreciated. Here is what I have and if it is not enough then let me know and I can post more code.
private void button10_Click(object sender, EventArgs e)
{
if (radioButton1.Checked == true)
{
string[] newHeaders = new string[dataGridView1.ColumnCount];
int n = dataGridView1.ColumnCount;
int c = 0;
for (c = 0; c < n; c++)
{
newHeaders[c] = dataGridView1.Rows[0].Cells[c].Value.ToString();
if (newHeaders[c] == "A1ORDT")
{
dataGridView1.Columns[c].DefaultCellStyle.Format = "d";
}
}
}
else if (radioButton2.Checked == true)
{
//Add code for custom formatting
}
else
{
MessageBox.Show("Please select standard or custom formatting");
}
}
|
|
|
|
|
Hello
I have soft of a half problem, where i know the cause of the problem, but don't know how to solve it exactly.
What i want to achieve: I want to check if outlook, excel and word are installed in the host computer when the user launches the program and inform the user if there are some complications.
My problem: I have application that uses excel, word and outlook. In every computer that has Office installed the program works and i even don't have to publish my application, instead copying the release folder is enough. But the application doesn't even launch on hosts, instead i get cut off very beginning and therefore i can't even show my informative messages, that don't have office installed and i get clr20r3 error.
How far im to solve the problem: I have found a problem cause in the following quote
Reference to problem cause http://social.msdn.microsoft.com/forums/en-US/winformssetup/thread/53c2de93-ab33-41d0-b5dd-7ca5fbfa5c24/[^]
post 4
Hi all,<br />
<br />
I have found the solution to this issue, it is due to dependancies. (I've just found out one of my employee's installed a second program onto the first virtual machine) This is why it gives a filenotfound exception as it is trying to load this program.<br />
<br />
When you use third party dll's that are not installed on windows by default the built in publishing tool inside VS.NET will not include these in the distributable it builds for you. I do not understand why i doesnt do this but i am switching all my distribution to Install Shield from now on.<br />
<br />
To fix your applications what you need to do is to look at your references (in solution explorer and in insertable objects) and make sure that you copy these dll's and dependancys onto the machine you want to install to and do a regsvr32 -i <dll><br />
<br />
I hope this helps you guys,<br />
<br />
Kind Regards,<br />
Chris Allen<br />
Technical Director<br />
UK National Networks LTD</dll>
This post also explained shortly what i can do to solve this problem, tho it didn't help me much.
What i want to achieve: I would like to by pass this error and still be able to launch my program. And then show some informative messages to the user and take necessary actions.
What i have tried to solve the problem: I made sure that i had following 3 DLL files in my release folder and when i published they would be included.
Interop.Microsoft.Office.Interop.Outlook.dll
Interop.Microsoft.Office.Interop.Excel.dll
Interop.Microsoft.Office.Interop.Word.dll
So that all the DLL files for my dependencies in program would be there. And what happened was that i got a bit different error
PLATFORM VERSION INFO
Windows : 5.1.2600.131072 (Win32NT)
Common Language Runtime : 2.0.50727.1433
System.Deployment.dll : 2.0.50727.1433 (REDBITS.050727-1400)
mscorwks.dll : 2.0.50727.1433 (REDBITS.050727-1400)
dfdll.dll : 2.0.50727.1433 (REDBITS.050727-1400)
dfshim.dll : 2.0.50727.1433 (REDBITS.050727-1400)
SOURCES
Deployment url : file:
IDENTITIES
Deployment Identity : IOMailer.application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=943730f75ed49f00, processorArchitecture=msil
APPLICATION SUMMARY
* Installable application.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of H:\IOMailer.application resulted in exception. Following failure messages were detected:
+ Downloading file: + Could not find a part of the path 'H:\Application Files\IOMailer_1_0_0_0\IOMailer.exe.manifest'.
+ Could not find a part of the path 'H:\Application Files\IOMailer_1_0_0_0\IOMailer.exe.manifest'.
+ Could not find a part of the path 'H:\Application Files\IOMailer_1_0_0_0\IOMailer.exe.manifest'.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [27.04.2009 16:52:45] : Activation of H:\IOMailer.application has started.
* [27.04.2009 16:52:45] : Processing of deployment manifest has successfully completed.
* [27.04.2009 16:52:45] : Installation of the application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [27.04.2009 16:52:45] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
- Downloading file: - Source: System.Deployment
- Stack trace:
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Net.WebException
- Could not find a part of the path 'H:\Application Files\IOMailer_1_0_0_0\IOMailer.exe.manifest'.
- Source: System
- Stack trace:
at System.Net.FileWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.FileWebRequest.GetResponse()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
--- Inner Exception ---
System.Net.WebException
- Could not find a part of the path 'H:\Application Files\IOMailer_1_0_0_0\IOMailer.exe.manifest'.
- Source: System
- Stack trace:
at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)
at System.Net.FileWebRequest.GetResponseCallback(Object state)
--- Inner Exception ---
System.IO.DirectoryNotFoundException
- Could not find a part of the path 'H:\Application Files\IOMailer_1_0_0_0\IOMailer.exe.manifest'.
- Source: mscorlib
- Stack trace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
at System.Net.FileWebStream..ctor(FileWebRequest request, String path, FileMode mode, FileAccess access, FileShare sharing, Int32 length, Boolean async)
at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
I have also tried to dig into this problem, but in all the explanation there are things that i don't understand and therefore can't rinse out the right solution.
Summary: I hope i have given enough information so you would be able to suggest me with simple solutions
Thanks
Hendrik
|
|
|
|
|
Does the file (H:\Application Files\IOMailer_1_0_0_0\IOMailer.exe.manifest) exists?
|
|
|
|
|
thanks man, it helped cos i just didn't notice that folder when i copied the application.
tho i got another error which says that i have to install assembly stdole in GAC, but i don't want to bother you anymore, cos im sure im accapable of solving this problem on my own
|
|
|
|
|
Okey my problems are not really solved still.
I solved stdole.dll problem.
But now clr20r3 error came back and i can't run my setup in any computer either on the one that has office and on the one that has not.
But you already know the story of my problem from the first post and therefore i will not start repeating my self Smile and hope that some one has a solution for my problem.
|
|
|
|
|
I have an odd one - or odd to me at least.
public void Encrypt(Stream sIn, Stream sOut)
{
string Routine = "Encrypt: ";
if (key == null)
{
throw new Exception(Routine + EX_CRYPTO_NOKEY);
}
if (sIn.Length > int.MaxValue)
{
throw new Exception(Routine + EX_CRYPTO_TOOBIG);
}
sOut.Write(encAlg.IV, 0, encAlg.IV.Length);
CryptoStream encrypt = new CryptoStream(sOut, encAlg.CreateEncryptor(), CryptoStreamMode.Write);
byte[] abIn = new byte[sIn.Length];
sIn.Read(abIn, 0, (int) sIn.Length);
sIn.Close();
encrypt.Write(abIn, 0, abIn.Length);
encrypt.FlushFinalBlock();
encrypt.Close();
key.Reset();
}
public void Decrypt(Stream sIn, Stream sOut)
{
string Routine = "Decrypt: ";
if (key == null)
{
throw new Exception(Routine + EX_CRYPTO_NOKEY);
}
if (sIn.Length > int.MaxValue)
{
throw new Exception(Routine + EX_CRYPTO_TOOBIG);
}
int totalBytes = (int) sIn.Length;
=====>
=====> SEE BELOW
=====>
totalBytes -= encAlg.IV.Length;
CryptoStream decrypt = new CryptoStream(sOut, encAlg.CreateDecryptor(), CryptoStreamMode.Write);
byte[] abIn = new byte[totalBytes];
sIn.Read(abIn, 0, totalBytes);
sIn.Close();
decrypt.Write(abIn, 0, abIn.Length);
decrypt.Flush();
decrypt.Close();
key.Reset();
}
Replacing the bit marked ====> with the bits below
In Decrypt, if I try to read the IV from my encrypted file directly into encAlg.IV, the IV doesn't change.
sIn.Read(encAlg.IV, 0, encAlg.IV.Length);
If I read into a buffer first, then set the IV it works.
byte[] ab = new byte[encAlg.IV.Length];
sIn.Read(ab, 0, encAlg.IV.Length);
encAlg.IV = ab;
Any ideas?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
maybe that IV buffer is not the right size when you try to read directly. where as when using ab you have set the array size to be what is required... I don't know this for sure thou
for example, does the following work?...
encAlg.IV = new byte[encAlg.IV.Length];
sIn.Read(encAlg.IV, 0, encAlg.IV.Length);
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
No. the new encAlg.IV is still all zero after the read. (And predicably enough the decrypt yields garbage as you would expect)
Read into a buffer, set the encAlg.IV to the buffer and the decrypt works perfect. Weird...
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
I am working on a program to aid in troubleshooting a clinical application we use in house. The application is a .NET program that runs in a terminal server environment. I would like to return a stack trace whenever a user presses a "help button." This button will take a screenshot and return a list of all running processes. I would also like it to return a stack trace of any of the LTCDB (the application) processes running. Is there a way of doing this?
Chris Sims
Senior Applications Specialist
NHS Management, LLC.
|
|
|
|
|
Hi All ,
I have 50,000 entries on my Sql 2005 Table.I would like to know the first time each distinct objects gets in to my table.
Lets say object1 has 10 records on my table at diffrent date ,object2 gas 100 records on the table,object3 has 500 records in the table registered at different date.
I would like to reterive each objects with there first entry only,how would i do it?
Please advice.
THank you all
|
|
|
|
|