Thank you for your help. As a student finishing up his degree and carrying 18 hours in his final semester it is useful to have a board like this to help out when you have a brain freeze.
Of course it would be more helpful if some people didn't go so far out of their way to stroke their own ego by making others feel stupid (IE: What do you think....is fo?), when they ask a simple question. But I guess it was my own fault for asking a question.
If you want the app to run when a user logs in then the suggestions already provided are the best way to do it.
If you want the program to start on startup regardless of whether or not a user is logged in then you need to install the program as a windows service. There was a great article on how to do this on osnews just the other day. Below is a link
I am having a problem playing mp3 files from my application.
I use the lame.exe to convert to mp3 from wav.
I use directX to play it.
In WinAmp3 it sounds perfect, but in my (and directX SDK sample) application it flickers and it is inpossible to hear annything but scrambeling noise.
First time I tried it out, I got an error message, something like "d:\...dx...ampifier.cpp", I then reinstalled directX and now it sounds
like scrambeling noise.
In advance THANKS
PS: Sorry about my english
Something might be wrong with the code - which you didn't post, so there's no way to help you. Please try posting some sample code - not the entire application.
It might also be better to post this in the Microsoft public newsgroups at news://msnews.microsoft.com[^] for the applicable DirectX newsgroup. This seems more like a problem with DirectX than a programming question if the samples aren't even working correctly.
i want to get the 7 dates of week. like if today is the 6 jan in calendar control 2nd day of current week. i want to get all the 7 dates from monday to sunday from(5-01-04 to 11-01-04)how can i get thoes dates from calender control.did u get my point or not.
First of all, Tuesday, January 6th, 2004 is not the 2nd day of the week in the en-US culture - nor in many other cultures - it is the 3rd. This all comes down to culture-specific information. Use the following to get what the day of week is for the specific culture:
CultureInfo culture = Thread.CurrentCulture;
int dayOfWeek = (int)culture.Calendar.GetDayOfWeek(DateTime.Now);
An enum like DayOfWeek can be cast to an int. In this case, the DayOfWeek members correspond to the number for the week, i.e. Sunday = 0, Monday = 1, Tuesday = 2, etc. You should add 1 to this value since most people think in base 1, not base 0.
Thank you very much for your help
could u give me some help that how can i create a Year View calendar in ASP.net in which i can show the user all the 12 month of a year and can navigate through diff years.
This isnt really a question relating to C# but the application that I am working on is written in C# and there isnt really another forum section which is relevant to my question.
Within my application I am taking various values pulled from an MS SQL database and creating a comma delimited CSV file, the problem is that the values in the db have various /n and and /r. In previous versions I have simply stripped this out as if they are present it causes the stream writer to generate incorrect CSV's. The problem is that, as a result of stripping these out, I loose any formatting.
An example is this query :
SELECT val1, val2, val3, val4 FROM table
The code then generates the following CSV file :
val1, val2, val3, val4
abc, def, ghi, jkl
Does anybody know of a way of creating the CSV with the /n and /r included? Double Quoting? Escaping?
post.mode = signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
Use a TextWriter and while writing each line, parse the string for each delimited value. If it contains a quote, carriage return, or line feed, quote the string. In the case that it does contain a quote, double-quote it. There really is no other escaping defined for common CSV (keep in mind there's really no "standard"). Excel displays carriage return, line feeds as boxes but a lot of other programs should accept it.
I would like to ask is there any fast way to get the intercept point of any 2 lines?
I have drawn many lines over the screen, and now want to point the red color circle on their intercepts.
What you need to do is solving linear equations. As you (may) know from college mathematics, the equation of a straight line on a X-Y plane has the following form:
y = kx + b
unless it is a vertical line, in which case the equation has the form
x = b
Here k and b are constants. If you know the equations of the two lines, then the coordinates of the intersecting point (if exists) will be the solution (x, y) of these two equations. So what you need to do is:
a) Find the equation of the two lines.
b) Determine if they have an intersecting point.
c) Find the intersecting point by solving these two equations for x and y.
a) You need to know two different points on each line. Say (x1, y1) and (x2, y2). If x1 = x2, then the line is vertical, the equation is x = x1. Otherwise, the equation is y = kx + b, where k = (y2-y1)/(x2-x1) and b = y1 - x1(y2-y1)/(x2-x1).
b) Suppose you already have the equations of the two lines: y = k1 x + b1 and y = k2 x + b2. If k1 = k2, then the two lines are parallel (there is not intersecting point). If the two lines are both vertical, then there is no intersecting point either. Otherwise the intersecting point exists (but it may not be on the screen, it may be 200 miles away).
c) After a) and b), you can solve the two equations to get the coordinates of the intersecting point. This is left as an exercise.
Hope you are not bored with the above lecture.
P.S. By the way, this is very fast. Even if you have 100 pairs of lines, the code you write will be executed instantly.
I would like to change dos prompt caption using C#.
Usually, we kicked bat file using Process.start() or double click, dos prompt caption is "c:\WINNT/system32/cmd.exe".
I would like to change another title.