|
hi,
I have the following question about an internet cafe software?
How can I coctrol the cafa PCs (lock and unlock)?
Is there any way to create a system restore point so whenever client installed any programs of files i can go back to my first image?
how to protect both above point from normal user from stoppong or closing it?
|
|
|
|
|
1. You need to totally block out all hot keys such as 'alt + tab', 'ctrl + alt + tab' etc. Google can help.
2. Restore points only remove installed programs, not files, these are designed to remove problems caused by faulty drivers etc. If you don't want users to install programs, run it on a limited account so they can't without admin permission.
3. You may be able to monitor the whole hard drive with a filewatcher, i've never looked into it, but it might track changes.
|
|
|
|
|
but i have seen in dubai and bangkok in some intenet cafes that thought they can control the PC but i am can still use all the mentioned keyboard keys.
Also i found in some cafes that when the customer finishes and they lock the PC and when the next customer comes the PC will be just like it was the first time the installed it on the cafe.
|
|
|
|
|
Hello everybody!!!!
I have a page which have the following form:
...
...
I want to access an element from "mainframe" using an object of System.Windows.Forms.WebBrowser class.
In contrast to JavaScript the property Webbrowser1.document doesn't have collection "frames".
Please anybody answer me!!!!
|
|
|
|
|
You need to post this question in the Web Development Forum.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hi,
I am currently building a window application and i want the system to use a single database connection for all its queries. So, i want to created a global connection object on login and use this very same object throughout my application when a database connection is required. Can you please help me on this?
Ps. The connection object instantiated on login should be visible throughtout the entire application.
|
|
|
|
|
datastruct wrote: I am currently building a window application and i want the system to use a single database connection for all its queries. So, i want to created a global connection object on login and use this very same object throughout my application when a database connection is required. Can you please help me on this?
What you actually want to do is create a DAL (Data Access/Abstraction Layer) class (or classes).
The DAL is either going to be a singleton or a static class.
Here is a very basic example:
public static Dal
{
private static SqlConnection theConnection;
public static ConnectionString
{
set
{
theConnection = new SqlConnection(value)
}
}
public static DataSet SomeQuery(int id)
{
}
}
-- modified at 6:50 Saturday 4th August, 2007
(Corrected code)
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
You forgot to make somequery static :p
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: You forgot to make somequery static
Oops!
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
Thanks pal.It did solve my issue.
|
|
|
|
|
Create one Singleton class.
This should have a member of type "OdbcConnection"
The connection to the database should be stablished in the constroctor of this class.
This class should have a member function to return the object of type "OdbcConnection".
Manoj
Never Gives up
|
|
|
|
|
Manoj Kumar Rai wrote: This class should have a member function to return the object of type "OdbcConnection".
Why an OdbcConnection?
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
How to open a file as a unicode char?
I used this :
<part of my code>
FileStream fs = new FileStream(open.FileName, FileMode.Open,FileAccess.Read);
StreamReader sr = new StreamReader(fs, Encoding.Unicode);
while (sr.Peek() != -1)
{
System.Console.WriteLine(sr.Read());
}
<end of my code>
But somehow it missed some characters.
In a file contain:
FF D8 FF D8 FF D8 FF E0 00 10 4A 46 49 46 00 01
My code only manage to read:
FF E0 00 10 4A 46 49 46 00 01
Anybody have the answer? Thanks before.
Training makes perfect....
|
|
|
|
|
Hi,
your file is not a text file, it looks very much like an image file using
JFIF format (a special version of JPEG). You can not open it as text; you could
open it as a binary file if that is what you really want.
Its main purpose is to let you load an image as in
Bitmap bm=Bitmap.FromFile("myFileName");
|
|
|
|
|
No... I want to open file whatever it is.
The main purpose is to open file like UltraEdit32 or somethine like that (hex editor).
So it can open every file and read it as a binary.
but somehow my program miss some hex like i said before.
thanks
Training makes perfect....
|
|
|
|
|
If you want to create an app that can read all file types, you must use
binary file operations, not text operations.
Text operations work for text files only, binary operations work for all
file types.
So you should use the BinaryReader class, you should not use anything that
is text oriented such as:
StreamReader.ReadLine()
File.ReadAllLines()
File.ReadAllText()
FileInfo.OpenText()
...
that is everything that has "Text" or "Line" in its name, or returns
a string or a char or a char[]. To read arbitrary data, you need a byte[].
If you decide the byte[] represents text after all, you can try and decode it using
the Text.Encoding class
MSDN holds an article "How to: Read and Write to a Newly Created Data File"
that should be of interest to you.
|
|
|
|
|
Life as a Coder wrote: But somehow it missed some characters.
No, it didn't. A unicode file starts with a BOM (byte order mark). That is not text, but a code that represents how the file is encoded.
-- modified at 11:04 Saturday 4th August, 2007
However, the bytes at the beginning of the file doesn't match any of the existing byte order marks. I believe that Mark has the correct explanation, and that your file simply isn't a valid unicode file.
---
single minded; short sighted; long gone;
|
|
|
|
|
0xD8FF is a 'high surrogate' in UTF-16. It represents the first of a two code-unit pair that encodes a character outside the 16-bit Basic Multilingual Plane (anything over U+10000). Because it's not followed by the second code unit of the pair, a low surrogate, it's simply discarded as being illegal.
'Encoding.Unicode ' really refers to the 16-bit scheme of encoding Unicode called UTF-16 or UCS-2. See UTF-16/UCS-2[^] on Wikipedia.
As the others have said, use a binary stream class, e.g. FileStream , and a method of reading that returns a byte array.
|
|
|
|
|
Hi I am developing a C# windows application in .net1.1
In this i have a form, in which i am taking the input parameters, if the parameters are valid i am passing the paramers to a method which is in another class. while passing the paramers i am disabling some buttons on the form. After completing the process i want to enable the buttons on the form from the class.
Is it possible to enable controls on the form from a class.
Thanks in Advance
Ramu
|
|
|
|
|
Ramu.M wrote: Is it possible to enable controls on the form from a class
yes
|
|
|
|
|
plz tell me how to do it? (Any guidelines of code)
Thanks for your reply
|
|
|
|
|
The other class must know about the form - so you must pass details of the form to the other class (remember, forms are classes too) somehow. Then the class can access the form. You must provide a mechanism on the form to receive the request
class MyForm : Form
{
...
public void DisableControls()
{
}
}
class MyOtherClass
{
private MyForm myForm;
public MyOtherClass(MyForm myForm)
{
this.myForm = myForm;
}
public SomeMethodThatNeedsToDisableTheControls()
{
...
myForm.DisableControls();
...
}
}
Does this help?
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
If you hold a reference to the form, you can manipulate everything on it that is
declared public, as in myForm.myButton.Enabled=true;
But it is considered bad design to make controls public, since everyone holding
the reference (myForm) can also replace, resize, move, hide, ... said control.
In fact, it is almost always wrong to provide public fields, only methods and
properties should be candidates for the public attribute.
An acceptable approach is:
- keep the controls private (or protected) to your form class;
- provide public methods (or properties) inside your form class, that offer
the required functionality to the outside world, no more, no less;
- pass the form's reference to your class and have it use the public methods
or properties.
And if you are familiar with delegates, they offer the best approach. It basically
means your form creates a delegate (that's like a function pointer connected
to the form's object), so now it can pass that delegate to your class, without
even having to pass the form's reference itself. That is encapsulation, provide
as little as possible, just give what is absolutely necessary.
|
|
|
|
|
Hi .
Yes you can , something like following code :
<br />
public class ControlForm<br />
{<br />
public static void EnableTextBox()<br />
{<br />
FrmTest frmTest = new frmTest();<br />
frmTest.txtName.Enable = true;<br />
}<br />
}<br />
Important :Set your control modifier property to Internal or Public
Bad Programming :Don't try to do this . It's not a smart coding .
DMASTER
|
|
|
|
|
Even you can use Delegates for Enabling/Disabling controls of the Form. The Delegate will remove the requirement to declare control objects (Text etc) public.
Manoj
Never Gives up
|
|
|
|