|
Is is THAT urgent that you have to post this question twice?
David
|
|
|
|
|
Well the problem is i hv a listview in which files of all types (media, doc, txt etc.) are listed , i want to open each of them in their corresponding application by double clickin on them.i want to use some API in the click event of the listview that wud search for the executable of that file by looking at its extension.
how do i do that?
|
|
|
|
|
you can simply use System.Diagnostics.Process as follows
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents=false;
proc.StartInfo.FileName= this.listView1.FocusedItem.Text.ToString();
proc.Start();
If you look at the eventhandler property of listview, you will see it has the DoubleClick eventhandler associated with it. So simply insert the above code into this event handler. However you need to remove "this.listView1.FocusedItem.Text.ToString();" and use the event handler input argument as a substitute.
|
|
|
|
|
Use System.Diagnostic.Process[^].
It works the same way as if you double-clicked file in Explorer, Windows search Registry for exacutable (e.g MS Word, Paint or browser ) associated with extention (.doc, .bmp, .html).
All you need to know is file name.
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
Hey Everybody!
I created an application that that is using the IE AxWebBrowser com component (to surf the net...).
so using my "new" web browser I can surf the net, but I want to create an off-line homepage using web forms.
the problem is that it doesn't matter what I do, I never see the page correctly!
I want to use my asp page to run things in my c# application, so I created the web form in a different project (because it is impossible to add web form to a c# project), and write down the code as it was in my app, but as I wrote down earlier, when I surf that asp page I cannot see the buttons, just the label I used in the form.
HELP ANYONE???
thanks!
|
|
|
|
|
How are you surfing the ASP page? What URL are you using? Are you running IIS or some webserver on your PC?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
well, I guess thats what I did wrong
I've never used asp before...
how should I surf to the page?!
|
|
|
|
|
You need to run a ASP.NET (or ASP, if you're using plain ASP) capable web server. IIS (Internet Information Services) comes as part of Win XP Pro, you can use that or use one of the free webservers (like Cassini).
Create a virtual directory (let's call it mypage). Put ASP page in that directory. Start the webserver and navigate to http://localhost/mypage/yourpagename.asp
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
oh okay
no problem, it works fine on my computer. vs.net created it for me so the aspx and aspx.cs are in my http://localhost/mypage/ .
but if I want to run that asp page on someone else computer, how can I make windows create the 'http://localhost/' at my app's directory (so my page will be at http://localhost/mypage.aspx) or just controling the position of the localhost?
|
|
|
|
|
hi, i have a code works with oracle sql i want to change the problem in it that doesn't work with sql2000 soplease any one help me
the sql statement is:
select folderindex, NAME, PARENTFOLDERINDEX from pdbfolder
connect by prior FOLDERINDEX=PARENTFOLDERINDEX
start with PARENTFOLDERINDEX = " + indexx + "
order by(PARENTFOLDERINDEX)
it gives me an error on line to when i test it on the sql 2000 query analyzer so what is the solution
Thanks alot
Hamody
|
|
|
|
|
Hi!
First of all, sorry about my wrong english
So I have the problem:
I'm using my C# Windows application to start a given exe file with System.Diagnostics.Process.
The application starts correctly, but I want to manipulate the given application window properties eg.:title,size,topmost or something like thesee things.
How can I do this?
Thank's for the helpfoul people, I wait yuor answers.
Bes regards:
Nemo
|
|
|
|
|
I would like to make a schedule service that run jobs at a specific time.
Is there anyway that I can hook into the windows clock og windows scheduler and get events when the time is something specific.
I would like to avoid the Timers in .NET, because these run in a given interval, and not a specific time.
Any ideas?
|
|
|
|
|
Use a timer, and check DateTime.Now at ever smaller intervals.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Timers are not optimal for this job.
I thing all you need is to know current time System.DateTime.Now
and you can separate teh part of these date eg.: you can catch the current time: System.DateTime.Now.Hour and System.DateTime.Now.Minute
And if you specify an intervall nedd to be do somethig:
- define the intervall eg.:10 minute
- make a timer with a minimal chack intervall eg.:1 minute and start it
- catch current time
- when the timer elepsed just you need
<br />
<br />
private void tim_Elapsed(object sender, System.Timers.ElapsedEventArgs e)<br />
{<br />
<br />
if(curr==t+intv)<br />
{<br />
<br />
t=curr;
}<br />
<br />
}<br />
This only a little stupid method to do it, but it works, and hope helpful to understand mechanism.
|
|
|
|
|
hi,
i want to know if i can crate new mail accounts on my
mailserver via programming? help me...
|
|
|
|
|
Hello
I have a string with data divided by a ":". I would like to take the data from before the ":" and set as object key in a hashtable, and take the data after the ":" and set as the object value in the same hashtable. What is the best way to go about achieving this?
/regards
|
|
|
|
|
The string class has a split method for doing this. Assuming there is only ever one :, this is the one to use. If it gets more complex than that, use a regular expression Searching for the index of : and doing your own substrings is messy, definately your last port of call
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am having trouble using Stored Procedures. I am using C# .Net, and Visual Studio. In Visual Studio I created a 'SqlDataAdapter' and then generated a Stored Procedure which I will include as well a
s the code that I am trying use to call the procedure. Can someone get me ontrack!!;)
Thanks Norm
private void Save_Click(object sender, System.EventArgs e)
{
sqlUpdateCommand1.Connection = sqlConnection1;
if (sqlConnection1.State != ConnectionState.Open)
sqlConnection1.Open();
SqlCommand cmd = new SqlCommand("InsertCommandServices");
cmd.CommandType = CommandType.StoredProcedure;
SqlParameterCollection pc = cmd.Parameters;
pc.Add("[service-code]",SqlDbType.Int, 4, txtServiceCode.Text);
pc.Add("[service-description]",SqlDbType.Char, 30, txtSeviceDesc.Text);
pc.Add("[large-animal-cost]",SqlDbType.Money, 8, cbLargeAnimalCost.Text);
pc.Add("[service-description]",SqlDbType.Money, 8, cbMediumAnimalCost.Text);
pc.Add("[service-description]",SqlDbType.Money, 8, cbSmallAnimalCost.Text);
}
IF EXISTS (SELECT * FROM sysobjects WHERE name = 'InsertCommandServices' AND user_name(uid) = 'dbo')
DROP PROCEDURE [dbo].[InsertCommandServices];
GO
CREATE PROCEDURE [dbo].[InsertCommandServices]
(
@Param11 int,
@Param12 char(30),
@Param13 money,
@Param14 money,
@Param15 money
)
AS
SET NOCOUNT OFF;
INSERT INTO services([service-code], [service-description], [large-animal-cost], [medium-animal-cost], [small-animal-cost]) VALUES (@Param11, @Param12, @Param13, @Param14, @Param15);
SELECT [service-code], [service-description], [large-animal-cost], [medium-animal-cost], [small-animal-cost], [service-nbr] FROM services WHERE ([service-nbr] = @@IDENTITY);
GO
|
|
|
|
|
NormBohana wrote:
service-code
Put an @ in front of variable names
NormBohana wrote:
@Param11
Use those nice names here, instead of this meaningless stuff.
Looks OK otherwise. Why on earth are you selecting back the stuff you stuffed in ? Why not return something useful, like @@IDENTITY ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks Christian, Visual Studio generated the stored procedures like they are. I added the '@' to the variables, and the code runs but nothing is stored in the database. Do you have anyother ideas, I am stuck at this point. I am doing more research into the problem so any help that I can get will help.
Norm
|
|
|
|
|
Can you run the stored procedure in query analyser ? If you can, and it works, then the problem is in your code ( the SP looks fine to me, but you should check to be sure )
Also, have you stepped through to see if the code branch where it checks if the connection is open succeeds ? I don't see any code to notify you if the problem is that the connection is closed.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian, I can run the stored procedure in the sql analyzer, and its runs. I have since found out that my code was wrong. I have rewritten the code and here it is. I cannot find an example of what to in the datareader. Cannot you direct me to some doc. that I can use, it would help. I have purched Microsoft ADO.net its close but no example on how to use a insert stored procedure. Thanks
Norm
try
{
sqlUpdateCommand1.Connection = sqlConnection1;
if (sqlConnection1.State != ConnectionState.Open)
{
sqlConnection1.Open();
}
SqlCommand cmd = new SqlCommand("InsertCommandService");
cmd.CommandType = CommandType.StoredProcedure;
SqlParameterCollection pc = cmd.Parameters;
pc.Add("[@service-code]",SqlDbType.Int, 4);
pc.parameters[0].value = txtServiceCode.Text;
pc.Add("[@service-description]",SqlDbType.Char, 30);
pc.parameters[1].value = txtServiceDesc.Text;
pc.Add("[@large-animal-cost]",SqlDbType.Money, 8);
pc.parameters[2].value = cbLargeAnimalCost.Text;
pc.Add("[@medium-animal-cost]",SqlDbType.Money, 8);
pc.parameters[3].value = cbMediumAnimalCost.Text;
pc.Add("[@small-animal-cost]",SqlDbType.Money, 8);
pc.parameters[4].value = cbSmallAnimalCost.Text;
SqlDataReader rdr = pc.ExecuteReader();
if (rdr.Read())
{
}
this.Close();
|
|
|
|
|
NormBohana wrote:
pc.Add("[@small-animal-cost]",SqlDbType.Money, 8);
Lose the square brackets. Where did they come from ? I dunno why I didn't see that before.....
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello...
I'm trying to track the time for a user who login from Active directory in a domain controller. I'm having a problem with in which I don't know how to do that actually in real time, so that controlling the access of the user say about 10 hours only, after that the account will be disabled, I don't want that the user use these hours sequentially, but in a whatever manner he wants it, I mean login say for 5 hours then he logout, so my counter should check the remaining time for him , and if the total time is 10 hours the remaining time for him is 5 hours, so when he access again the domain controller he has only 5 hours remaining.
Can you help me with this problem, please.
Or if you know anyone who can help me with this problem or any articles discuss this problem.
Thanks in advance.
|
|
|
|
|
How can i do to replace Html Tag
For example in my project when i input <br> or <p> the error message will display
Could you can write an function in C# to replace the HTML Tag
Thanks for helping.
I tried so hard and got so far
|
|
|
|
|