|
You are welcome
|
|
|
|
|
Hi Everyone,
I am developing one windows application. In that application i'm using one webbrowser control to navigate web sites.I want to close that browser after some time.[Meaning I am accessing one web site after some idle time i want to redirect to login page.].
Thanks in advance.
Regards,
Raja Baireddy
|
|
|
|
|
Hi,
how about launching a System.Windows.Forms.Timer, and when it fires have it call myWebBrowser.Navigate()
to the page of your choice? (don't forget to stop the timer!)
|
|
|
|
|
Hi,
You are correct. for navigating purpose i'm doing same thing. whenever timer interval elapsed it will fire and it will redirect to login page.
It is redirecting to landing page. But still session is maintaing.
Suppose one user is logged into the site, Without logging out he left that one, after some time we are redirecting to index page.
There some other users can able to see his/her personal information.
[This problem is happening with the sites like codeproject.com
In codeproject.com they are using loginpage as well as welcome page is same.so that time it is giving problem for me.
]
Is there any way to kill that session information.
Regards,
Sekhar Reddy
|
|
|
|
|
I am unaware of any WebBrowser method that drops a session.
I would consider removing the WebBrowser and starting a new one.
|
|
|
|
|
I have tried to destroy the WebBrowser control and again i'm creating new instatnce of webbrowser. Still it is maintaing the session values.
|
|
|
|
|
I have an application which renders fonts in textboxes so the user can see what they look like. I then need to be able to delete that file. But when I try, I get an error because the file is locked.
I have figured out that if the textbox is never rendered to the screen, no lock occurs (so it's not the pfc or ff stuff, nor is the file read-only) (also, once I stop debugging, I can delete the file manually).
The Kicker: Only certain Fonts do this. bajoran.ttf gets this error, but TKDS9HOL.TTF does not.
Here is my code. Anybody have any ideas?
------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO; //manual add
using System.Drawing.Text; //manual add
namespace FontFileTest
{
public partial class Form1 : Form
{
string strFile = "bajoran.ttf";
//string strFile = "TKDS9HOL.TTF";
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
PrivateFontCollection pfc = new PrivateFontCollection();
pfc.AddFontFile(strFile);
FontFamily ff = pfc.Families[0];
txt.Text = "Sample";
txt.Font = new Font(ff.Name, 12, FontStyle.Regular);
txt.Visible = true; //remove this line, will not lock
ff.Dispose(); //irrelevant
pfc.Dispose(); //irrelevant
}
private void btnDelete_Click(object sender, EventArgs e)
{
//extra stuff to try--irrelevant
txt.Font = new Font("System", 12, FontStyle.Regular);
txt.Dispose();
Application.DoEvents();
this.Refresh();
try
{
File.Delete(strFile);
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
return;
}
lblStatus.Text = "Deleted";
}
}
}
|
|
|
|
|
Umm, this might be a stupid answer, but are you sure that case-sensativity can't be causing that bug..?
|
|
|
|
|
I did actually think of that (and tried some stuff), but no, that did not make a difference.
|
|
|
|
|
Run the app as administrator? Make sure you have delete privs on that file?
|
|
|
|
|
The file is probably in use, and you can't delete things that you're still using.
Keep an array of filenames that you wish to "delete", and delete them when you're done using them (on program close?)
I are troll
|
|
|
|
|
Well, I figured out a way around it, if anyone else encounters this. Using a PictureBox and graphics.DrawString (instead of a TextBox) does the trick. The code below was cut from different methods & some stuff taken out, so it may be incomplete, but you should get the picture.
Graphics g;<br />
Bitmap bm;<br />
StringFormat sf = new StringFormat();<br />
PrivateFontCollection pfc = new PrivateFontCollection();<br />
pfc.AddFontFile(strFile);<br />
FontFamily ff = pfc.Families[0];<br />
<br />
f = new Font(ff.Name, 12, FontStyle.Regular);
PictureBox pb = new PictureBox();<br />
pb.Width = 280;<br />
pb.Height = f.Height + 4;<br />
pb.BackColor = Color.White;<br />
pb.BorderStyle = BorderStyle.FixedSingle;<br />
<br />
bm = new Bitmap(pb.Width, pb.Height);<br />
g = Graphics.FromImage(bm);<br />
g.TextRenderingHint = TextRenderingHint.AntiAlias;
g.DrawString(ff.Name, f, Brushes.Black, 0, 2, sf);
<br />
f.Dispose();<br />
pb.BackgroundImage = bm;<br />
<br />
|
|
|
|
|
i need to disable ctrl,shift,tab,windows key
is there any coding to disable them and enable them
plz help me
|
|
|
|
|
You can use windows hook for that. There are several articles here at codeproject that show how to use them.
|
|
|
|
|
He was already answered Here,[^] I assume he just want's code[^] written for him to do his task, but he won't bother to read[^] anything of value to help him out.
|
|
|
|
|
hi,
As i m developing cyber cafe software so when user logout from pc need to close all program,as like user may working on internet explorer as time over it need to close automatically.
so i need to close all application after time is over.
i need it through coding in vb.net.
|
|
|
|
|
Use Process class provided by .Net Framework.
|
|
|
|
|
hi,
i have an mdi container that forms are opened inside a panel.
is it possible that if an mdi child generated a message box, this message box will belong to the opening form and hence i can open another form and continue working.
because now when a form generated an error i can not click on any area in my application. thanks
|
|
|
|
|
Well, one option is to create your own version of a MessagBox using a simple Form.
|
|
|
|
|
|
You can't. There is no code you can write that will disable it.
And reposting the same question over and over will not change the answer.
|
|
|
|
|
hi,
I am trying to create a custom installation package that won't take my end users very many steps.
Currently there are
-- Install .dot net (which I am not worried about because most of the machine have it already (and it runs with the setup.exe that I created from Visual Studio)
-- Install SQL Server Express with management studio Create the database by running the sql scripts within Management Studio and install the software itself. Though this process does work, I would like to make it a little easier. Our end users aren't exactly technically expert and will run into problems. Also with my limited experience of SQL Server, it is hard to rectify created instances, etc without a lot lof work that they won't understand.
my question is can we have a custom package, which consists of all the above and runs in single step.
|
|
|
|
|
For various reasons I want to be able to bind customer business objects to a DataGridView rather than use Datasets. I have developed a class that implements IBindlingListView so that I can sort and filter them, however, I also want to be able to provide RowState functionality similar to that provided by Datasets. I will add a RowState property to my customer business object, however, I need to understand how to properly update this property using the DataGridView events. If anybody has some thoughts on which events would be useful I would appreciate any input
Thanks!
Jim
|
|
|
|
|
I beleive there are celledit/cellenter events that will allow you to identify the rows to be flagged as dirty, set the state of the object.
There is also a beforecelledit I think that may be usefull. Seems the real trick is to pick the correct event to use!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
hi,
i have a datagridview on a usercontrol "products" hosted from a form "productsform".
my grid shows a dataset by using a bindingsource bsproduct with nearly 500 records.
by clicking a row in the grid i want to show a detailform "productdetailform" with a usercontrol "productdetails" that has textboxes and displays the values.
after changing the data, the row in the dataset should be updated, and the productdetailform should be closed.
how can i handle this ?
i thought i can deliver the bindingsource bsproduct to the productdetailform and bind my controls to the Usercontrol productdetails.
delivering the bindingsource to productdetailform is ok, but how can i access the bindingsource in the code of the userontrol productdetails ??
bye jo
|
|
|
|