|
I have a need to build a class that can unlock in use files so that they can be deleted. I need to do this from within my code without using any third party executables. Preferably in VB.Net or C#.NET with the help of pinvoke for any api calls. Any sugestions or existing source would be a great help.
--
"Keyboard not found. Press < F1 > to RESUME. "
Source unknown (appears in many common BIOSes as a real error message)
|
|
|
|
|
Why would you want to do this? So you can crash the app that has the file open? That's about the only end result you're going to get.
|
|
|
|
|
I love the way half of the people on here seem to think they know more than everyone else and feel the need to tell you that what your doing is wrong and yet not offer a solution before they even take the time to ask what it is your really trying to do...your not someone special that we all need to here your words of wisdom and be corrected on what we are doing...I'm working on a project where it is at times necessary to delete a file that is in use if you can help(i don't need it anymore), then please do, if not, then don't go running around being the hallway monitor to see if anyone is running
--
"Keyboard not found. Press < F1 > to RESUME. "
Source unknown (appears in many common BIOSes as a real error message)
|
|
|
|
|
|
Thanks, I will give this a try
--
"Keyboard not found. Press < F1 > to RESUME. "
Source unknown (appears in many common BIOSes as a real error message)
|
|
|
|
|
Glad to help you.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
Had to make some small modifications, but this worked perfectly for what i needed. Thanks alot
--
"Keyboard not found. Press < F1 > to RESUME. "
Source unknown (appears in many common BIOSes as a real error message)
|
|
|
|
|
You are welcome
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
Hi,
I have some class libraries, which I dont want the client to use.
How can we secure our dll in such a way that if someone else adds our dll to his project then it gives some error or may e do not allow to add it.
Or is tehre any other way by whihc we need not send the DLL in the setup.
|
|
|
|
|
the problem is if you make it so that your client can't use it, then neither can you. You can implement some security by requiring a certain key be passed in to your method calls, and you can protect against reflection and disassembly by Obfuscating your dll.
You can use Dotfuscator Community Edition included with VS2005/8 to do that for you.
Hope this helps!
Greg
|
|
|
|
|
The problem:
Among data stored in dataset are strings with Croatian characters (Windows CE, code page 1250).
First I've used simple method for writing data to xml.
someDataTable.WriteXml(someStream);
At first glance it was perfect, but when xml file was opened with Wordpad and some domestic application which uses ton of legacy code written in C++ (MFC) Croatian characters weren't correctly displayed, well haven't been displayed at all (windings-like characters and "hieroglyphs").
So I decided other approach, to store data as xml to memory stream and then to turn data to string...
someDataTable.WriteXml(someMemoryStream);
byte[] buffer = someMemoryStream.GetBuffer();
File.WriteAllText(xmlPathName, Encoding.UTF8.GetString(buffer), Encoding.UTF8);
The result was that all text/xml editors I had available were displaying strings correctly, but above mentioned application didn't.
What else can I do? Fiddling over legacy code is last option I'll try (for 3 years I'm working with .Net almost exclusively, my C++ experience was gained in college and in some side educational projects .
|
|
|
|
|
Hi all,
can somebody help me to say WebBrowser component not to load multimedia stuff like pictures, music, etc .. ?
Why? I'm developing aplication which is used usually in the field, so only slow connection to internet via mobile phone is available. Cancelling loading pictures will increase the speed of browsing the web pages....
Thank You in advance
|
|
|
|
|
Is this going to be connecting to sites that you have control over? Certain sites have text only versions that you may be able to use.
|
|
|
|
|
Unfortunatelly not. I'd like to du quick browsing within my application without loading multimedia stuff.
Any idea?
|
|
|
|
|
I have a problem deserializing a structure on the server side while I can deserialize it fine on the client side. Not sure why. Comments please
Client code (MyTxBuff is a structure of mixed data types):
if (SendStruct(ref MyTxBuff, ref dataArray) == true)
{
Stream stm = tcpclnt.GetStream();
stm.Write(dataArray, 0, dataArray.Length);
Console.Write("sent fine");
// deserialize
// dataArray is in the stream stm
// define another stream that contains the dataArray buffer.
Stream stream2 = new MemoryStream(dataArray);
// now define a formatter
IFormatter formatter = new BinaryFormatter();
// but create first a structure to hold the deserialized data
TxBuffer1 myTx1 = new TxBuffer1();
// deserialize the stream
myTx1 = (TxBuffer1)formatter.Deserialize(stream2);
On the client sied, myTX reads the expected values.
On the Server side I receive dataArray values into bytesRead array (identical values on client and server). I use the same de-serialization code on the server side but I get exception. Bot data arrays are of the same dimensions. The server code is :
byte[] bytesRead = new byte[1024];
int k = Socket1.Receive(bytesRead);
// deserialize
// define another stream that contains the bytesRead buffer.
Stream stream2 = new MemoryStream(bytesRead);
// now define a formatter
IFormatter formatter = new BinaryFormatter();
// but create first a structure to hold the deserialized data
TxBuffer1 myTx1 = new TxBuffer1();
// deserialize the stream
myTx1 = (TxBuffer1)formatter.Deserialize(stream2);
|
|
|
|
|
Attached to the serialized data is the name/version of
the assembly that defines the type of the serialized data.
The system attempts to use that same assembly to get the
type info required to deserialize the data into an object
of the same type.
You can make the same assembly available on both ends
or use a SerializationBinder[^] on the deserializing end.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
modified on Wednesday, September 3, 2008 11:39 AM
|
|
|
|
|
Father class how to use the special sub-category type (such as sub-class form the TableAdapter of a table), the current idea is adding traversal of all the things on the form(such as traversing all controls on the form), if found what I need, I want to transform the type and use it as the class I want. But now i can not change the object I found into the type I needed. Thanks a lot.
Code is as follows:
private void findcontrol (Control.ControlCollection controls)
(
foreach (Control ctrl in controls) / / This traversal of a similar type of controls or components
(
if (ctrl.GetType (). Name == "customers TableAdapter") / / form on a table, the TableAdapter
(
/ / Ctrl-type into the TableAdapter customers to use
/ / Cases, TableAdapter.Update (customers DataTable);
/ / Ctrl like to, as with customers TableAdapter
)
findcontrol (ctrl.Controls);
)
)
modified on Monday, September 1, 2008 9:01 PM
|
|
|
|
|
Again, don't cross post. Geeze.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
sorry again.i really didn`t know which part should this question belong to so .. .But i wouldn`t cross post next time.
|
|
|
|
|
Hi guys
Just curious
How do I get the base score in Windows Vista within C# or any other app?
Been searching the web but no luck.
Thanks
|
|
|
|
|
Hi,
I'm an absolute newb at this - I'm writing software for a psychology experiment (in vb.net) and I need to have an event triggered by when the subject speaks. I don't need anything fancy (I think), just something that will detect when the amplitude of the sound coming from the microphone is above some threshold. Any ideas?
I'm really green - all the previous programming I've done has been by copy-and-paste from websites and tweaking it to get it to work, so if anyone can point me to an online bit of source-code I'd be very grateful.
Thanks!
Mark
|
|
|
|
|
My VS 2005 app will work with .NET 3.0, but defaults to .NET 2.0 if that is present. How can I make it so that it will use the latest version of .NET wherever possible, and will only revert to .NET 2.0 as a last resort?
Thanks!
|
|
|
|
|
You could upgrade to VS2008 and recompile against .NET 3.0 or change the supportedRuntime[^] element in your app.config.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Thanks for your reply! But I don't want to take away Framework 2.0 support, I just want it to prefer the newer framework when both are present. Maybe I should explain more about why I want this:
Our software benefits from 64-bit features, but we noticed than on many 64-bit customer machines, it was actually running in 32-bit mode. The reason for this was that even though their Vista 64-bit was coming with .NET 3.0 installed, at some point some other software was installing .NET 2.0 86x, and our software was suddenly defaulting to using that instead. It would be nice if we could keep our .NET 2.0 support, but still have our software prefer 3.0 when present so that it had a higher chance of running as a 64-bit app on 64-bit systems.
|
|
|
|
|
You can add multiple supportedRuntime elements. The order they are listed determines the preferred order.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|