Charles Cox - MSFT's Q&A profile
Visual C# Security - normal practise? Please reply
Hi, I'm building an app in C#. I won't bore you with the details, but basically I have two security questions. Any help would be much appreciated! 1. I will be saving files on a external server. I would like to encrypt the files before sending them. Different 'users' will be using this app. What are the best practices regarding C# to encrypt files Public/Private key encryption Where would I store the keys...in the registry I'm well versed with regards the cryptography in theory, but do not have much experience in practise. What API's....where Etc, etc...Any ideas .. 2. The application be will be using a third-party service, which requires a username/password. I suppose this username and password will be kept on a database somewh ...Show All
Visual Studio Express Editions noob question: what do windows applications use as a db?
sorry but I have this totally noob question. I'm completely new at writing windows applications, and want to learn. I have a book (sams learn in 24hours), and it briefly goes over ADO. My question is, besides writing to a flat txt file, what do windows applications use as a database Obviously your standard XP desktop doesn't have a db server, so how do programs save information I'm basically creating a database, but want it to be an installable program, not an MS Access db. But I'm having trouble figuring out what to do in regards to a DB. I see you can use localized db's inside VB, but I keep reading that the user would still need sqlserver express or is that wrong Examples are some of the best ...Show All
Visual Studio Express Editions Help with "Concentration" Game
I am a student studying VB for the first time and I've run into a snag programming as assignment. It's a matching game consisting of 8 pairs of matching words randomly assigned to 16 labels. When a label is clicked, the word currently assigned to it will display. If two labels are clicked and the words match, the labels are disabled and change their color. This is done until all 8 pairs of words are found, after which a message box is displayed indicating the game is over. I am confused as to how I can randomize the list of words and assign them to the labels, as well as how to check for matching. Any help would be appreciated. Right. I just thought it might simplify the code to have them all under one sub. ...Show All
Windows Forms run time error
Dear All I have very bad bug in www.rotary3080.org in below happy birthday and happy anniversary link i code on mouse over show picture of birthday on mouseover happy anniversary show picture of happy anniversary it is running ok on the localhost when i deployed online then it shown Runtime Error why please help me i use access database for it use module for it.error in web.config why any one could help me please. Regards Irvendeep Your post is very confusing but if i understand it right, you got a webpage that's working fine on localhost but fails online with a certain errror. edit: I just checked the site, not realy helpful error indeed. did you already changed your config file like sugested c ...Show All
Windows Forms How to do ? synchro folder local machine and ftp site?
I want to write an application that watches an folder on my local machine for new files , deleted files ,new folder , delete folder, or change a file content... and then copy them to the FTP site for processing. (do the same job on ftp server delete,new,move...) Is it possible to use the FileSystemWatcher any example was gratefully. thanks Gavin Jin - MSFT wrote: there are many softwares in web which can reliazie the Synchronize ftp with your local mashine,sunch as FTP Synchronizer Professional and so on. Thanks Thanks Thanks I always do not know this software Thanks for your help ...Show All
Visual Studio Express Editions Setup problem.
When I launch the msvcs.exe or the msvc.exe they get to the point where it says " Setup is loading installation components. This may take a minute or 2." It's been like 5-10 right now, is there a fix Tyrael Tyrael117 wrote: When I launch the msvcs.exe or the msvc.exe they get to the point where it says " Setup is loading installation components. This may take a minute or 2." It's been like 5-10 right now, is there a fix Tyrael Hi I have the same problem ... i'm installing from the file vwdsetup.exe ... what can the problem be Queenyard ...Show All
.NET Development SQLCommand insert not working for dataset with more than one row.
I am trying to insert data into 2 tables, Order and Order_Item, in a transaction. Everything works fine if I only have 1 row in my objCartDT datatable. If I have only one row, the 2 tables are updated as expected. But if I have more than one row in the objCartDT datatable, something fails, and I can't figure out what (but I suspect it has to do with the params in conjunction with "cmdNewOrder_Items.ExecuteNonQuery();" and the looping I'm trying to do. Maybe not. I will paste the function that is called on button click (to submit the order). I am using a MS Sql server database. public void btnSubmitOrder_Click(object sender, EventArgs e) { SqlConnection objConn; ...Show All
Visual Studio 2008 (Pre-release) Why can I not obfuscate a WPF app
For some reason I cannot run any WPF app once it's been obfuscated (I'm using the latest version of Dotfuscator Pro). It can be run if renaming is disabled in Dotfuscator. Does anyone know of a list of items to exclude from renaming (rather than disabling it completely) in order to use obfuscation on WPF applications Thanks for any ideas. Just tested the Postbuild 'link into one assembly' feature and that fails also. I know that someone could disassemble back to 'source' code. Can anyone get back to the original XAML. I suspect not but don't know. John ...Show All
Visual C# Schedule Event
Hi again... I need to run this every day at the same time or once a week on a predefined day and hour. How's it done Been through allot of research but couldn't make it work This is the event i need to schedule private void BackUp() { Cursor = Cursors .WaitCursor; SQLDMO. _SQLServer srv = new SQLDMO. SQLServerClass (); srv.Connect(server, username, password); SQLDMO. Backup bak = new SQLDMO. BackupClass (); bak.Devices = bak.Files; bak.Files = BackupFolder + database + ".bak" ; bak.Database = database; bak.SQLBackup(srv); this .Cursor = Cursors .Default; } catch ( Exception err) { this .Cursor = Cursors .Default; MessageBox .Show(err.Message, &quo ...Show All
.NET Development ArrayList Serialization Error
Hi, I'm trying to serialize/deserialize an ArrayList and am getting the error "There is an error in the XML documentr at (0,0)". Looking at the InnerException tells me that the "Root element is missing". How do I get round this My code is here: try { string filename = "test.xml"); XmlSerializer serializer = new XmlSerializer(typeof(ArrayList), new Type[] { typeof(cube) }); if (File.Exists(filename)) { FileStream fs = new FileStream(filename, FileMode.Open); cubes_arl = (ArrayList)serializer.Deserialize(fs); } cube new_cube = new cube(); new_cube.nodeID = nodeID; cubes_arl.Add(new_cube); XmlTextWriter writer = new ...Show All
Windows Forms The following CTRL+keys doesn't get the correct KeyEventArgs during KeyDown events
Hi, It seems that the following key combo are not raising any key events: CTRL+L, CTRL+E, CTRL+R, CTRL+J Testing it using the following codes: public Form1() { InitializeComponent(); this .KeyDown+= new KeyEventHandler ( this .OnFormKeyDown); this .fileToolStripMenuItem.Click+= new EventHandler ( this .FileMenuClicked); } private void FileMenuClicked( object sende ...Show All
Visual Studio Team System Can't remove Ghost project from source control or add project with same name
We have a ghost project in our source control explorer. I tried using TFSdelte to remove it says it doesn't exist. So when I try to create it it says it is already there. Here is what it says when I try to create the project. If it already exists, why can't I delete it Thanks for any help you can provide. Error TF30004: The New Team Project Wizard encountered an unexpected error while initializing the Microsoft.ProjectCreationWizard.Portal plug-in. Explanation TF30171: The Microsoft.ProjectCreationWizard.Portal plug-in used to create the new team project could not be initialized and returned the following error: TF30270: Project site folder "Engage 2006" already exists. ...Show All
Windows Forms Using visual inheritance with the UserControl
Hi there: I have a UserControl where I defined som controls (groupbox and buttons) and I'd like to inherit from this to create other user controls (generic functionality, etc.). I am using C#. I exported my UserControl as a template and now I have it as part of the "Add new item" wizard. However, none of the controls are visible in the designer. Moreover, if I try to assign properties to these controls in my InitializeComponent method (I know, shouldn't do that, I just wanted to try to see if it works) I get an error in the designer saying the control is not defined. Is this even posisble, or should I go try some other approach Thank you, Thanks for the input, it works like that now (sort of). What I have ...Show All
Game Technologies: DirectX, XNA, XACT, etc. A struct / types what ever you call em in C#!
I am creating a space shooter game. So far you have a ship that moves, and a Scrolling bg. Exciting Isn’t it. I used to program in blitz basic and they had a thing called a type that could create multiple objects with multiple similar variables. Like if I were to create 20 alien ships with there own x positions and speed, witch I gave each a random value. Each LV I would add 5 more aliens to the LV until it became impossible. How could I create a type or something similar in C#. Also how can I give a variable a random value. Would using a List<AlienSpaceship> be better The ship class could have an IsAlive member that is used to determine whether or not to render and update it. You'd avoid ha ...Show All
Smart Device Development How to return values using stack with ml64
Currently I'm developing a 1394 device driver for windows x64. I my driver i use an timing function, but that needs to be in asm. The 32 bits version of the driver uses inline assembly, but in x64 this is not allowed. So i use ml64 because there's no intrinsic for rdtsc. My code: __int64 GetMachineCycleCount() { volatile __int64 cycles; _asm rdtsc; // won't work on 486 or below - only pentium or above _asm lea ebx,cycles; _asm mov [ebx],eax; _asm mov [ebx+4],edx; } But now i need to make this in ml64. But you may not use things like this: GetMachineCycleCount PROC x:QWORD How can i return the value to my c code, without using global values. That's my temporary solution for now. This is a mobil ...Show All
