|
Windows XP is a pure windows OS not like 98,95,Me so if you want to change the res you have to call Win32 functions see MSDN for details
|
|
|
|
|
It appears that you are trying to use DOS technology in Windows.
You have no direct acces to interrupts anymore since NT 3.0 (1993??) and up.
You have to find the Windows way to change this, because your program runs in protected mode ring 3 and your hardware can only be accessed when your program runs on ring 0, which is the area if the device drivers, like graphics drivers, printer drivers,...
Windows 95, 98, and me did let you access the hardware. But NT like technology does not let you do this, this to increase stability of the system.
Ik hope this helps?
You will have to jump to a modern programing language that can create Windows programs I am afraid.
|
|
|
|
|
Hello,
I want to get the files from a directory, and their order are sorted by their DateTime. I hope to list all file in the listview after sorting.
The following code I used to get files in directory.
<br />
DirectoryInfo di = new DirectoryInfo(path + "\\");<br />
FileInfo[] theFiles = di.GetFiles(); <br />
<br />
foreach(FileInfo theFile in theFiles)
{<br />
ArrayList FileArrayList = new ArrayList();<br />
FileArrayList.Add(theFile.FullName);
}
what should I do right now? I don't know how to sort the collection of Files in dateTime order..
Or, I need to list all files in ListView first, and the sort it in ListView?
Please help me with example...
Thanks a lot
|
|
|
|
|
As far as I know you can't do an order by datetime. I needed the same for doing some directory cleanup. Here is how I did it.
private void DirectoryCleanUp(string directory, string fileName, int maxNumberOfFiles)
{
DirectoryInfo dirToClean = new DirectoryInfo(directory);
FileInfo[] fi = dirToClean.GetFiles(fileName);
int fileCounter = 0;
int pos = 0;
//if (fi.Length < maxNumberOfFiles) return;
DataTable dt = new DataTable("DirClean");
DataColumn counterCol = dt.Columns.Add("Counter",typeof(int));
DataColumn nameCol = dt.Columns.Add("FileName",typeof(string));
DataColumn dateCol = dt.Columns.Add("LastWritten",typeof(DateTime));
//Build dataset including filename and date of creation.
foreach (FileInfo fileTmp in fi)
{
DataRow row = dt.NewRow();
row["Counter"] = ++fileCounter;
row["FileName"] = dirToClean.FullName + @"\" + fileTmp.Name;
row["LastWritten"] = fileTmp.LastWriteTime;
dt.Rows.Add(row);
}
//Get position in dataset where file(s) to be deleted are
pos = fi.Length - maxNumberOfFiles + 1;
//Get file(s) to be deleted
DataRow[] rowToDelete = dt.Select("Counter < " + pos.ToString(),"LastWritten ASC");
foreach (DataRow rowFile in rowToDelete)
{
try
{
//Delete file
File.Delete(rowFile.ItemArray.GetValue(1).ToString());
}
catch (Exception ex)
{
//Error handling here
}
}
}
Hope this help
Regards
Rein
|
|
|
|
|
i've been using a program called adshield (http://www.adshield.org) for awhile now and i'm intrigued by it's explanation of how it operates.
essentially what it does is intercept the webpages you're viewing (or trying to view) and looks for any references to your block-listed urls and doesn't display them. for example, if i have blacklisted /images/banners/ any images that contain this in their url will be modified to be a blank image. or, if i've blocked /xxx/ any webpages that are trying to load with that in their url will be prevented from doing so.
and apparently, this is all done before the html/webpage reaches IE for rendering. and i would believe it as well since popups don't even appear for a nanosecond and blocked images aren't even displayed when i load a webpage for the first time.
so does anybody have any idea how this is done?
also, if people would like to download the older 1.2 version (which was freeware), please let me know and i'll post it somewhere along with my blocklist. works with IE only.
thanks.
|
|
|
|
|
Ok, here is what should be a simple question, but I have not been able to find it in the help files. I am writing a console application in C#. I would like to see a system pause like System.Out("PAUSE") in C++. Is there an easy way to do this?
|
|
|
|
|
Hi,
I' am looking for some sample code for the following problem :
I have a listview with 2 columns. Firt I have to select the column on witch the keypress will be evaluated.
When I do a keypress, the listview must automatically select the item that begins with that character.
Then a next keypress, the listview automatically look for the item who have taht char on the second position (and the first char = first keypress).
etc.....
Example :
1000
1100
2000
2100
2110
I press 2 : the listview select 2000
then I press 1 : the listviw select 2100
...
Thanks for a hint.
Nic
|
|
|
|
|
strange i'm just running a listview in C# , if i press keys while the listview is selected it automatically finds the strings
eg:
<br />
abcdefg<br />
iam some text<br />
item1<br />
sometext<br />
if i press the letter "i" , it finds "iam some text" , but if i then press the letter "t" it finds "item1"
<font color="blue">Private void</font> ExpectingTwins(<font color="blue">string</font> twins)
{
<font color="blue">switch</font>(twins)
{
<font color="blue">Case</font> ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
<font color="blue">break</font>;
}
}
|
|
|
|
|
Yes, it is true.
But how I do it if the listview has two columns? When I focus the listview it works fine for the first column. But I want that I can select the second column and do the same thing.
Example : The listview a column zipcode and a column town.
Sometimes I known the zipcode and sometimes I know the town (but not the zipcode).
|
|
|
|
|
plz.. some body help out in converting .doc file to .gif file using c#
|
|
|
|
|
are you able to read .doc file atleast !
if so , you can read one by one line and by using graphics object and drawstring,
you can create bitmap in memory and then save it
|
|
|
|
|
can u send me small example on it...
|
|
|
|
|
Initialize two Filestreams, one to your doc file, one to your gif file. Read the doc file into a byte array, then write the byte array into the gif file.
Does that help?
Nick Seng (the programmer formerly known as Notorious SMC)
God, I pity me! - Phoncible P. Bone
|
|
|
|
|
WiB wrote:
I receive 403 error when client tries to connect to server
How to bypass this error?
do u have the firewall !
are you trying to reach outside your company intranet !
or it is within company internet !
|
|
|
|
|
Look at the authentication mode in the web.config file
<a TITLE="See my user info" href=http:
|
|
|
|
|
WiB wrote:
Server doesn't have a cofig file
Then copy the one from the WWWroot
<a TITLE="See my user info" href=http:
|
|
|
|
|
Hi,
I'm writing a windows service, and I need the service to save data in the currently logged in users home directory (my documents). Is there a way to get the path for it?
I know Environment.GetFolderPath(Environment.SpecialFolder.Personal), but it gets the home directory of the user who runs the service (in my case the local system account).
Thanks in advance!
Greets,
Daniel
|
|
|
|
|
Do you already know anything about the currently logged in user? If so, you might want to try impersonating that user and then trying the command you just described. (Never done it, but read about it a few times.)
John
John
"We want to be alone when we hear too many words and we feel alone when it has been a while since anyone has spoken to us." Paul David Tripp -- War of Words
|
|
|
|
|
I doubt there is a managed method for doing this.
Under C# this will be cumbersome (lots of Interop calls), maybe the best way is MC++, but the only way I know for a service to interact with the logged in user(s) is by calling OpenWindowStation. In your case, you should call the GetUserObjectInformation to get the user SID, then go to the registry and recover the path of the user's home directory.
Not for those who fear API calls.
ORACLE One Real A$#h%le Called Lary Ellison
|
|
|
|
|
How can I map the server path in an asmx file for FileIO purposes. Relative path seem to return errors.
Tia
|
|
|
|
|
I'm talkin' absolute rubish and trying to Server.MapPath a global variable before initialising the class.
Sorry dudes.
|
|
|
|
|
Hi,
I'am searching a hint or a good example for following problem :
I have zipcodes and towns. One zipcode can be attached too 1 or more towns
ex. 1000 Town1
1000 Town2
1001 Town3
1002 Town4
...
In my form a combobox is not efficient (there are too many zipcodes and towns). So, I need another button that opens a dialogbox. This dialogbox show all records (zipcode - town) and when I double-click on a record I come-back too my form, where the choosen zipcode is in one textbox and the town in an other textbox.
Thanks in advance for the hints or the examples.
Nic
|
|
|
|
|
This type of thing is done fairly often. I'd suggest browsing through the C# projects already on this site until you find one that opens a sub-dialog and then retrieves the values selected. (In fact, the SaveFileDialog and OpenFileDialog boxes that are part of the .NET framework do the same type of job.)
John
John
"We want to be alone when we hear too many words and we feel alone when it has been a while since anyone has spoken to us." Paul David Tripp -- War of Words
|
|
|
|
|
In order to be able to switch the Tracing level on our application (which is a service) without stopping it, I implemented a Trace wrapper that watches fot the app.exe.config file to be noticed on any change on it (NotifyFilters.LastWrite ). The wrapper has other utilities too and is compiled in a class library.
I wrote a small exec that tests the wrapper. When I start the program in debug mode (F5 ), and I change the config file using a file editor, the program is noticed (the FileSystemWatcher.Changed event is raised). But when I start the program in non-debug mode (Ctrl-F5), and I change the config file, the program is NOT notified of the change.
Do anybody have any clue of what is happening?
|
|
|
|
|
Anyone knows what is the equivalant of InternetCheckConnection(...) in C#??
Weiye, Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|