|
How can I delete a file witn C#, witch is in use?
|
|
|
|
|
Simple, you can't. The filesystem won't allow you to do that.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Nothing is inpossibile
In Google I fuond a C++ executable witch delete locked files too, Somethime I use this, but I need a way to do this in C#.
|
|
|
|
|
If you can get them to cough up the source code, great!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have no clue that how can I set c+ classed to call c# classes. For example, I am using c++ on dialog and I am clicking on button from c++ dialog,then it will call new dialog or class that contains C# coding. I know what are you thinking. Why are you do that? I am using c# coding and my co-worker is using c++ coding so we have to put them together somehow. any suggestions??
|
|
|
|
|
|
|
Hi all,
Is there an alternative available to Aspose.Word? (managed if possible!) The Aspose pricing is just out of this world. It would cost us $1500 for just 1 developper.
Basically, we are looking to create mail merges from code. Using Word automation is out of question.
Thanks!
|
|
|
|
|
Depending on your merge data, and the appearance you want, you could use a crystal report to make your word files.
ExportType = CrystalDecisions.[Shared].ExportFormatType.WordForWindows
rpt = New CrystalDecisions.CrystalReports.Engine.ReportDocument
rpt.Load(ReportFilePath)
rpt.SetDataSource(ds)
<br> <br>
DestinationOption = New CrystalDecisions.Shared.DiskFileDestinationOptions
ReportOutputFile = DestinationPath
DestinationOption.DiskFileName = ReportOutputFile
<br> <br>
crExportOptions = rpt.ExportOptions
crExportOptions.DestinationOptions = DestinationOption
crExportOptions.ExportDestinationType = CrystalDecisions.[Shared].ExportDestinationType.DiskFile
crExportOptions.ExportFormatType = ExportType
rpt.Export()
The dataset needs to be a strongly typed dataset in order to bind it to crystal. You can just get 1 record at a time into the dataset and export the report in a loop. You can also output to pdf if you prefer.
|
|
|
|
|
I need to take an existing Word document and merge data (ie: names and addresses) into it.
|
|
|
|
|
I try to move a directroy from C:\ drive to D:\ but Directory.Move or DirectoryInfo.MoveTo methods don't allow this.
So how can I do this? And the same question for Copy.
|
|
|
|
|
Did we just go over this a few weeks ago?!
You can't Move from one volume to another. You can only Copy the source to the destination, then delete the source.
As for the Copy operation, you never showed us any code that is doing the copying and you haven't mentioned any exception messages. WIthout either of those, it's impossible to say what went wrong.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank's I found the problem.
|
|
|
|
|
I've downloaded a solution from this site.
If i run the debug it make the .exe file and the dll.
I'm newbie abou this so i don't know wy it make this dll and where in the project propertyu it is commanded to make this dll.
I want understand what is it in that dll.
Thanks
|
|
|
|
|
You can generate a dll by creating a new project and selecting project type as "Class Library". You can always change it by right clicking on the project in Solution Explorer, clicking Properties and changing the Output Type in the resulting dialog.
If the dll has been generated by another project in the same solution, you can go to that project to see what's inside it. Otherwise, you have to use a decompiler (like Reflector) to see the contents.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Are there two projects in the solution? One would probably be a class library and the other, the Windows Forms application.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Then you answered your own question. One project creates the .DLL, the other is the Windows Forms application that uses it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Sasuko wrote:
I've downloaded a solution from this site.
What about link? It would be very helpful...
David
|
|
|
|
|
I followed this MSDN article[^] (click on the Structs Sample link). My code is practically identical.
//Original structure
typedef struct
{
DWORD dwVar1Type;
WCHAR szVar1Name[MAX_VAR1_NAME];
} VAR1_A, *PVAR1_A, FAR *LPVAR1_A;
//C# equivalent
public struct VAR1_A
{
public UInt32 dwVar1Type;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=MAX_VAR1_NAME)]
public char[] szVar1Name;
}
The problem is, I can't seem to find an example of what to do with the pointer *PVAR1_A and the FAR pointer *LPVAR1_A.
|
|
|
|
|
You don't do anything with them. These are for creating a pointer to this structure in C/C++ code. C# has no equivilent.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
They're just typedefs, so instead of struct YourStructName variable , you can do VAR1_A variable . As Dave pointed out, they aren't needed in C#, you can simply do VAR1_A variable .
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
|
Hi, is there a way to read the names of the members of a late binding System.__ComObject?
I try to edit a Chart in Excel, but until now I get only the Charts-Object of Excel:
objSheets_Late = objBook_Late.GetType().InvokeMember( "Worksheets",<br />
BindingFlags.GetProperty, null, objBook_Late, null );<br />
objChart_Late =objBook_Late.GetType().InvokeMember("Charts", <br />
BindingFlags.GetProperty, null, objBook_Late, null );
But I do not know, how to get the Objects like Axis and their properties.
Ariadne
Cancer Research Switzerland
|
|
|
|
|
I'm trying to determine the dimensions of a string as it will appear in HTML. The closest way I've been able to do this is to use a graphics object and use MeasureString. However, there seems to be a slight difference between GDI and HTML with the dimension of strings. Does anybody know how I can reliably measure the string?
Thanks in advance.
|
|
|
|