|
Thanks for the tip.....propertybag aaa
rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
Hay
I don't know if it's possible or not ...
can I get any file that the user copy it on the hard disk ..
thanks
jooooo
|
|
|
|
|
Theoretically yes, put a watch on every directory. There may be an OS call to copy a file you may be able to monitor. No that does not make sense, too many apps can access the file system!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
thanks my friend for your attention
jooooo
|
|
|
|
|
Hey kindman_nb,
check the FileSystemWatcher class. You can set this to start watching at the root of your file system to get each and every file. However, it does not tell you explicitly which files were copied, only which files were created, updated, renamed or deleted. So in order to check for copied files you would have to keep a reference of files created and files removed. If you have the same file removed and created elsewhere in a short period of time, it's probably going to have been copied. Of course this only works if the file is being copied with the same name.
Let me know if this applies to your case. If not try to provide some more details.
Cheers,
Marcelo
|
|
|
|
|
thanks Marcelo .. it's ok now
jooooo
|
|
|
|
|
im trying to write a battleship program. Bt cannot figure how to get the two grids to show in an array. any help on this would be greatly appreciated.
|
|
|
|
|
To get the grids, you simply need to have two for loops that loop through the specific amount of pixels to form a grid. My Tetris program may be help with getting the general appearance for your grid: http://www.codeproject.com/KB/vb/FallingBlocks2008.aspx[^].
For my battleship program that I created awhile ago:
>The grid was a user control that was self painted with events for placing the ships
>The logical layer was separate from the graphical layer so I did not have to worry about exact pixel specifications
>The logical ships were stored in a collection. The ship object contained generic coordinates along with the size of the ship and image location of the ship
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
i have this code so far
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication21
{
class battleships
{
const int SEA_WIDTH = 10;
const int SEA_HEIGHT = 10;
static int[,] sea = new int[SEA_WIDTH, SEA_HEIGHT];
}
static void clearSea()
{
// Clears the sea to empty
}
static void placeShips()
{
placeShips battleship
// Places ships as follows:
// Battleship: (0,2) and (1,6)
// Cruiser: (0,4), (1,0) and (9,9)
// Submarine: (5,5)
// Rowing boat:(7,8)
}
static void displaySea()
{
// Displays the sea on the users screen
}
{
static void Main(string[] args)
{
}
}
}
how can i make this work
|
|
|
|
|
It appears like you are in the very early steps of the battleship program creation process. So, I would suggest that you map out the program with what classes will be needed, what properties/methods need to be exposed in those classes, create a basic layout for the appearance of the form, etc.
Once you have a blueprint of the entire program that I can help you formulate the blueprint into code. I believe I posted my battleship program (not code) on my website awhile ago: http://homepages.umflint.edu/~thstockw/[^]
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
I'm importing data from a csv file and I need all the fields to be read in as text fields.
I have a zip code field that when I need to put in ZipCode+4(12345-6789) it throws an err because the field is interpreted as a int32 or some such.
I don't see any options anywhere to force the driver to make all the field text either. I thought this is possible, I'm pretty sure it would work with the Jet drivers if they were installed.
If they are installed, they are not showing up in the ODBC Data Source Administrator.
Connection.ConnectionString =
string.Format(@"Dsn=CSV;dbq={0};defaultdir={0};driverid=27;fil=text;maxbuffersize=2048;pagetimeout=5", new FileInfo(openFileDialogGetCRDCSV.FileName).DirectoryName);
|
|
|
|
|
|
That would almost work except the header names are subject to change. The file also comes in with column names with "." and it converts them to "#". I think I'm going to have to switch to a CSV parser of some kind.
|
|
|
|
|
Sunset Towers wrote: header names are subject to change
That doesn't matter. You don't have to name the columns (set ColNameHeader to true) and if you do, it's the name you decide, not the name in the file.
Sunset Towers wrote: The file also comes in with column names with "." and it converts them to "#".
Din't quite understand this.
|
|
|
|
|
The column names are something like column.name which csv is coverting to column#name. Not a big deal.
I can set the column names as they move around also. It's weird and a pain but I'll have to find a different solution.
|
|
|
|
|
|
You may want to take a look at this CSV parser[^] and then use Bulkcopy to load the data into a table. I always use a staging table and a stored proc to do my ETL.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yeah that is a the route I had to take in the was just to get a csv parser.
|
|
|
|
|
Hi All,
I'm just trying to find some info on how to tell xUnit to output the results from a set of tests I've written for some C# code. Info seems really thin on the ground for this. Can anyone post some info/links on how to set this up?
Thanks,
|
|
|
|
|
Hi,
I have an MDI application, with five different child forms. (developing in Visual Studio 2008 C# windows Form Application)
I added Serial port to MDI Form.
How can I use that serial port instance (created on MDI Form) on a child Form?
Thanks
Karmu
|
|
|
|
|
I think you should create methods for using serial port on MDI form and call them from the child form. You can find the MDI form from child form using child's MdiParent property.
|
|
|
|
|
hi,
im trying to make an alarm that will just alert in a specified time lenght. Mean it will have 2 parts, First start Time and second End Time. Hope you got my question. I wrote code but it just work till end time is less than 00:00.
For example
If StartTime is 23:00:00 and EndTime is 23:59:00, it will work
but if StartTime is 23:00:00 and EndTime is 01:00:00, it wont
here is the code
DateTime StartTime = new DateTime(1, 1, 1, 23, 52, 40);
DateTime EndTime = new DateTime(1, 1, 1, 1, 01, 10);
if (DateTime.Now.TimeOfDay.CompareTo(StartTime.TimeOfDay) > 0 && DateTime.Now.TimeOfDay.CompareTo(EndTime.TimeOfDay) < 0)
{
MessageBox.Show("Came");
}
i know DateTime.Now.TimeOfDay.CompareTo(StartTime.TimeOfDay) returns 1 if the time is less than 00:00:00 and greater than the parameter TimeSpan else -1
but i'm not getting any idea since mind is very tired because of lots of proccess
i thought to place a bool variable when that time past but problem is that what if user open the pc when time is 1:00:00 then it wont work
any idea guys ?
thanks
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi,
You are just being far too specific in your comparison. Just compare the DateTime values, i.e. the date and the time of day.
Something like this:
DateTime EndTime = DateTime.Now.AddHours(1);
if (EndTime.CompareTo(DateTime.Now) < 0){
MessageBox.Show("Came");
}
[EDIT: My initial code fragment was rubbish. It make sense now! ]
Alan.
modified on Sunday, December 7, 2008 5:28 PM
|
|
|
|
|
dude, you misunderstood my question. I want comparision in time not with date and time. I do not need date, just time.
for example :
if user open the computer between 23:00 - 01:00 then shows a message to him/her. but problem is 00:00 as i told in first post
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
One way is to split the logic. Something like:
- if the end time > start time, simple check if current time is between start and end
- if the end time < start time it means that you're crossing midnight, then:
- check if current time > start time => alarm
- or if current time < end time, => alarm
|
|
|
|