For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
I have made a c# program that writes a binary file of approximately 16 MB, then proceeds to process the file by reading and writing individual bytes after specific rules.
Generating the inital file runs without any issues, but when the actual processing starts, so do my problems:
staticvoid Main(string args)
FileStream Stream = new FileStream("test.file", FileMode.Create, FileAccess.ReadWrite, FileShare.None);
int NumReads, NumWrites;
NumReads = 0;
NumWrites = 0;
for (i = 0; i < 1024 * 1024; i++)
for (i = 0; i < Stream.Length; i++)
Stream.Position = i;
if (i % 16 == 0)
Stream.Position = i + 8;
int y = Stream.ReadByte();
Stream.Position = i + 10;
Console.WriteLine("Loop done. Reads="+NumReads.ToString()+", Writes="+NumWrites.ToString());
ConsoleKeyInfo result = Console.ReadKey();
if (result.Key==ConsoleKey.Escape) break;
(Cannot seem to get rid of the extra pre tag, and the extra end bracket after the application
The process is painfully slow, and the program appears to be reading huge amounts of data during the process, according to Task Manager, during program execution, it looks like the program is reading 300 MB/second, or more, which is about what my HDD can do. The number of writes performed are looking normal.
I have tried implementing counters for read and write operations, and these seem to match what I am trying to do.
I have tried lots of different buffer sizes when initializing the FileStream, but the results are the same.
I dont know whether it is Task Manager being off, or c# actually messing up I/O so badly.
I am developing a web application which has to make asynchronous calls because I have to make sure UI thread is not hanged.
In my application I have around 15 projects like SampleProject1, SP.BLSP, SP.Web, .. Also for every service call there is two minutes timeout.
I am trying to implement signalR in my code for waiting until each function is executed completely. Please see the following sample code.
After the first service call completed, it calls the second. The second call will surely takes more than two minutes. It might take more than 10 mins.
And I need to use results from first service call in second.
When implementing signalR, I tried to install Microsoft.Owin It asked for which project to add. I am trying to add SignalR Startup class in my SampleProject1.
I am not sure if:
1. SignalR is right way for doing this approach or not.
2. If I can use SignalR, in which project should I add this Microsoft.Owin
I tried google but most of them showed how to implement in new project and with out web service calls.
public partial class lengthProcess : UserControl
FirstWebServiceCaller1 FWbSvcCallr1 = new FirstWebServiceCaller1();
FWbSvcCallr1.Process1Completed += new EventHandler(FirstWebServiceCaller1_Process1Completed);
I'm not sure exactly what you were asking there, but it appears as though you want to know how to increase the timeout. Is this correct? If it is, you should look to configure the ConnectionTimeout as described here[^].
Your best bet is to collect some information:
1. The computer are you using (Make, Model, etc.)
2. On your computer investigate all of the installed devices using the device manager (found under Start/Settings)
3. Once you've found the device in question use the context menu and open the property dialog.
4. Go through all the tabs and see what drivers and dlls are installed for the device.
5. Use all of the above information to make intelligent queries on the internet using your favorite search engine.
6. Also contact the maker of your computer if the device came preinstalled and ask them about information of said device.
"I had the right to remain silent, but I didn't have the ability!"
I'm going to make a video file from images on .NET using Aforge.Video.FFMpeg.dll.
But I have only FFMpeg.dll which compiled on .NET3.5.
I think compile .NET wrapper.
Unfortunately, I couldn't search Aforge.Video.FFMpeg source.
Out of randomness, I updated the library to the latest FFmpeg version. I have it as .NET 4.5.2, but I will gladly do a 4.5 build for you if you want. Do you need MSVC 11 (VS 2012) or MSVC 12 (VS 2013)? Or is either fine?
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
Request.Browser[^] which is of type HttpBrowserCapabilities[^] has a property called Browser[^] which you can use to detect the browser that is using the application. From there, you should be able to do a redirect to the specific page depending on what is in the value of that particular property.
Signature construction in progress. Sorry for the inconvenience.
Hi all, my home page accesses a csv file when it loads and populates certain elements on the page with data from the csv file. Right now I have yet to implement authentication so there is no need to login. I tried to see how its performance will be affected by multiple users accessing the csv file simultaneously by hosting this app on my home server and opening the app in multiple tabs in IE.
The page hangs and I had to reset my server each time it hangs. So the question I have is, is opening the same app (copying and pasting the url) in a new tab considered to be using the same session or is it considered to be using a new session.
If the app is hanging due to the same session being used multiple times simultaneously, how do I solve this problem? Thanks for your help.
I have some sample code I cannot get to work. I think its because I'm tired. I am trying to send strings from a randomly generated text file. The goal is to find the lowest random # representative string. I have sent the strings as arguments to a method that is supposed to loop through the text file and see if there is a match and when the string is found display it in a rich text file. When I do this with a messagebox it works fine displaying the correct order of argument matches with text string matches in the loop however when I try to send it straight to the textbox it returns the last match. I know this is a silly way to do this but I cannot use an array or assign variables to the # or use an array.
privatevoid smallBtn_Click(object sender, EventArgs e)
FindSmall("1"); FindSmall("2"); FindSmall("3"); FindSmall("4"); FindSmall("5"); FindSmall("6"); FindSmall("7"); FindSmall("8"); FindSmall("9"); FindSmall("10"); FindSmall("11"); FindSmall("12"); FindSmall("13"); FindSmall("14"); FindSmall("15"); FindSmall("16"); FindSmall("17"); FindSmall("18"); FindSmall("19"); FindSmall("20"); FindSmall("21"); FindSmall("22"); FindSmall("23"); FindSmall("24"); FindSmall("25"); FindSmall("26"); FindSmall("27"); FindSmall("28"); FindSmall("29"); FindSmall("30");
FindSmall("31"); FindSmall("32"); FindSmall("33"); FindSmall("34"); FindSmall("35"); FindSmall("36"); FindSmall("37"); FindSmall("38"); FindSmall("39"); FindSmall("40");
privatevoid FindSmall(string searchKey1)
string path = @"C:Random # File.txt";
StreamReader sr = new StreamReader(path);
for (int k = 0; k < 20; k++)
richTextBox1.Text = "The smallest Number is: " + searchKey1.ToString();
The smallest Number is: 2The smallest Number is: 3The smallest Number is: 5The smallest Number is: 8The smallest Number is: 9The smallest Number is: 14The smallest Number is: 16The smallest Number is: 17The smallest Number is: 18The smallest Number is: 22The smallest Number is: 24The smallest Number is: 25The smallest Number is: 31The smallest Number is: 32The smallest Number is: 34
I thought the break statement was to stop the loop?
sorry I had the break out of focus
that worked great thanks for the help I just could not see it. that happens to me after i've been looking at something for a while.
how would I go about finding the lowest number in a text file w/o comparing each string in order without parsing it into an array and doing a bubble,selection or insertion sort on it.....any ideas, I'm at a loss.
the text file looks like this it is all #s and it is randomly generated each time
the app is run
I have to do 2 things with the text file that is generated. I have to put the #s in order and find the lowest one without using an array or assigning variables to be parsed. I have been researching the file class trying to see if i could create a temp file to hold them and then sort the temp file contents in some way. It is a hard problem given the constraints of not being able to use an array and a simple sort.
a little of it made sense I have studied regex a little. the problem is this is only my 3rd C#
class and I try to watch utube video tutorials as often as I can. I started in java.
the .NET library is impressive and I'm just now getting into it. The only clues the professor has given are that after we build the random generated text file with 20 numbers we are to use file manipulation methods to sort the #s. I only know the basics of streamreader and writer. the other hint he gave us was that we could create as many temp files to hold the numbers and merge them into a Sorted.txt file which we have to print those to a windows form richTextBox which does not have the capability of sorting. I was researching the capabilities of using the text files as containers.