|
That is what I was looking for and couldn't find, thanx very much
|
|
|
|
|
That examples work good with classes, but i would like to use struct and there is something tricky about it, you can't set a property of a struct using designer.
|
|
|
|
|
Hi,
I am trying to use the OWC to edit the cells in an existing excel file. I have done it with Interop.Excel, but that takes up too much memory which is why I am going towards the OWC. My problem is that I cannot seem to figure out how to even open the Excel File for editing. Here is my code of a sample project I am trying to do just to get started:
<br />
<br />
private void EditSpreadSheet()<br />
{<br />
<br />
<br />
spread = new OWC.SpreadsheetClass();<br />
spread.ActiveSheet.ConnectionString = "PR.xls";<br />
spread.Cells[2,"2"] = "Hi";<br />
<br />
<br />
<br />
<br />
<br />
}<br />
<br />
<br />
Sincerely,
The Major Rager
|
|
|
|
|
TheMajorRager wrote: spread.ActiveSheet.ConnectionString = "PR.xls";
You might want to supply the fully qualified path to this file.
|
|
|
|
|
Hi Dave,
Here is the new code I came up with however, this creates a NEW file instead of just changing the cells. Do you know how to make it so that it edits a file instead of creating a new one? Also, how much memory does OWC11 use on the server?
<br />
<br />
private void EditSpreadSheet()<br />
{<br />
<br />
<br />
<br />
spread = new OWC.SpreadsheetClass();<br />
spread.ActiveSheet.Cells[1,1] = "HELLO";<br />
spread.get_Range("A2:A2",Type.Missing);<br />
spread.Export(Server.MapPath(".") + "\\" + "PR.xls",OWC.SheetExportActionEnum.ssExportActionNone,<br />
OWC.SheetExportFormat.ssExportHTML);<br />
<br />
<br />
<br />
<br />
<br />
<br />
}<br />
<br />
<br />
Sincerely,
The Major Rager
-- modified at 17:33 Wednesday 27th June, 2007
|
|
|
|
|
TheMajorRager wrote: Server.MapPath(".") + "\\"
Seperate this line out so you can see the exact path it comes up with. Somehow, I don't think it's valid. Either that, or the ASPNET process doesn't have Write permissions to the path it's showing.
string filepath = Path.Combine(Server.MapPath("."), @"PR.xls");
|
|
|
|
|
Hello,
I have a 2 dimensional array that I need to add more elements to. Array.Copy and Array.Resize only work for one dimensional arrays. Any thoughts as to how I can accomplish this with a 2 dimensional array?
Thanks
|
|
|
|
|
Create a new array of the appropriate size and copy the elements from the old version to the new.
|
|
|
|
|
Hello,
Look at this post[^] from Mark J. Miller[^] where he was so nice to give the link to his job interview project.
In Version 1 you will easily find a method called "Expand2DArray" and also "Trim2DArray".
Hope it helps!
All the best,
Martin
|
|
|
|
|
Ok, thanks for the help. I'll check it out.
|
|
|
|
|
I have one program(app_1) that has only read access to drives and write access only to memory.
the second program(app_2) has access to memory and write access to drive.
How can I load a file or whatever in to memory (buffer) with app_1 and get that file or whatever in app_2
*********************
no access to clipboard,
app_2 can't access the file from app_1 on disk(thats fact)
most be done thru memory
and please don't send me to c++
If you can help then please do
Thanks a Bunch
|
|
|
|
|
Hi,
I am not sure what your app(s) are trying to achieve; maybe this is useful:
Windows supports the concept of "memory mapped files". They are very good at sharing data
between two processes. They support the situation where multiple processes can read/write
the same file, where the file is actually in memory (so it gets mapped in the address
space of each participating process).
I dont think .NET supports this directly; but applying P/Invoke on Win32 functions
such as CreateFile, OpenFile, WriteFile etc. solves this.
I have used this for logging: one app logs to memory, another process actually
consumes the log information and processes it.
|
|
|
|
|
do you have a small code snippet?
|
|
|
|
|
Hi,
I dont have it at hand, and I am not sure anymore about the Win32 function names;
it may well be things like CreateFileMapping, MapViewOfFile, etc.
And it would not be "a small code snippet", it really requires some setup code.
I suggest you search around (Google) for MMF or memory-mapped file.
|
|
|
|
|
|
Hi,
I want to create a demo for an application I have created in C# so as to work for only eight days when installed on a client machine
Kezy
|
|
|
|
|
Hi!
So what's the problem?
You have to either save the date of installation or the initial remaining time somewhere and then, during startup, calculate if your still within the demo time range.
But beware - with registy and file system watching programs it's quite easy to find out the location where you save your time information. That way one can always uninstall your app and re-install it to get another 8 days.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
as mav's said pure clientside solutions can easily be defeated. If you can require demo users to have a net connection and you have a 24/7 server you could have your app phone home with system details such as mac address, harddrive serials, etc to your server to ask for permission to run. Organized hackers will still be able to edit your application to disable the checks. If possible limited functionality in a time unlimited demo is probably more effective at forcing a user to go from the demo to the full version of your application, than a fully featured demo with a time limit.
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
Hi, for creating a demo application that runs only for 8 days, u can enter the date/time settings in a text file, that will be created during the application installation. change the ext of the text file to something else, and during the installation , make it a point to install the file in some safe area of the client machine that normally he does not /cannot access. Also make sure to make the file hidden. This will defeat any attempt to uninstall the app and reinstalling it to get 8 more days, since uninstalling the app will delete only the program related files and not the text file that u create from ur C# code. So each time the application is opened up this file will be checked for some status flag, upon not finding the correct value, the app wont start.Just try this technique on ur machine first.
Cheers
|
|
|
|
|
gladiatron wrote: install the file in some safe area of the client machine that normally he does not /cannot access.
Where would this be? If the user has got the rights to write the file during installation, then he'll be able to get the neccessary access rights to delete the file. Simple as that, nothing you can do about it.
gladiatron wrote: This will defeat any attempt to uninstall the app and reinstalling it to get 8 more days,
What should anyone keep from deleting the file?
Even beginners can have a program monitor the creation of a file, if you try to ofuscate what you're doing by making the file hidden then it's even easier to find.
There are lots of applications that log every file and every registry key written to during an installation and they will easily defeat this overly simplistic scheme.
Using a feature-crippled version or a web-based licensing is much effective.
P.S.: If 'u' follow the forums here '4' a while 'u'll see that people here really don't like people writing 'u' instead of you. The only valid reason to do this is if your keyboard is broken and the Y and O keys are missing, which doesn't seem to be the case on your side.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
How can i get a window's icon? (by it's handle).
Just so it's clear: i'm not talking about my own program's window, but about another window.
|
|
|
|
|
|
Hello I have to obtain a process whose owner is Current User, actually I´m getting a process like this:
string processname1 = "msiexec";
System.Diagnostics.Process[] myprocess1 = System.Diagnostics.Process.GetProcessesByName(processname1);
But there are two instances of the process, one Current user’s process and the system´s process.
Thank you!!!
José Guzman
|
|
|
|
|
You can P/Invoke OpenProcessToken[^]. Get the token information and check if the username and the process name are the one you want and do the operation you need to do
Or use WMI
System.Management.ManagementObjectSearcher moSearch;
string sQuery = "";
System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("msiexec");
foreach (System.Diagnostics.Process p in processes)
{
sQuery = "Select * From Win32_Process Where ProcessID = " + p.Id;
moSearch = new System.Management.ManagementObjectSearcher(sQuery);
string[] args = new string[5];
foreach (System.Management.ManagementObject mo in moSearch.Get())
{
mo.InvokeMethod("GetOwner", args);
if (args[0] == strCurrentUser)
{
}
}
}
|
|
|
|
|
hi
how can raise an event in c#?
for example in VB.NET we can write follow code to raise an event :
RaiseEvent SendMessage(message);
tanks
|
|
|
|