|
no one ?
|
|
|
|
|
Help please
Does anyone know an elegant way to initiate a bash/perl script (to run on a linux box) from a windows form written in C#?
Thanks
|
|
|
|
|
Never did it, but I think that the most straight-forward way would be to connect to linux through ssh and run commands.
Check this[^] article from CP.
|
|
|
|
|
Another idea is to use a folder which both machines share.
On the Linux machine, a program checks that folder for new files, and if a new file is encountered, that program then executes some actions depending on the file.
This method requires that you develop such an "observer" for Linux and get it running on the Linux machine before your users try to start something from your Windows program.
|
|
|
|
|
This seems way to convoluted and overly complex to be "elegant". Don't you think?
|
|
|
|
|
Excel Exception from HRESULT: 0x800AC472
I am exporting data to excel thru C# code.
while export is in progress, if I open any excel file (not necessariliy the one being created), I get the above error.
Earlier I was exporting on a background thread, but after reading various comments on google, I removed the background thread but the problem still exists.
Gurpreet
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:18am.
|
|
|
|
|
I have created a simple application to show the problem:
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
Microsoft.Office.Interop.Excel.Application _objAppln;
Workbook _objWorkBook;
Workbooks _objWorkBooks;
Worksheet _objWorkSheet;
public Form1()
{
InitializeComponent();
InitializeExcelObjectModel();
}
~Form1()
{
DisposeExcelObjects();
}
void SaveExcel()
{
_objAppln.DisplayAlerts = false;
_objWorkBook.SaveAs("C:\\tmp.xls",
XlFileFormat.xlWorkbookNormal, Type.Missing, Type.Missing, false, Type.Missing, XlSaveAsAccessMode.xlNoChange,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
_objWorkBook.Close(true, "C:\\tmp.xls", false);
_objAppln.DisplayAlerts = true;
}
private void InitializeExcelObjectModel()
{
_objAppln = new Microsoft.Office.Interop.Excel.Application();
if (_objAppln != null)
{
_objWorkBooks = _objAppln.Workbooks;
_objWorkBook = _objWorkBooks.Add(Type.Missing);
_objWorkSheet = (Worksheet)_objAppln.ActiveSheet;
}
}
public void DisposeExcelObjects()
{
System.Runtime.InteropServices.Marshal.ReleaseComObject(_objWorkSheet);
System.Runtime.InteropServices.Marshal.ReleaseComObject(_objWorkBook);
System.Runtime.InteropServices.Marshal.ReleaseComObject(_objWorkBooks);
System.Runtime.InteropServices.Marshal.ReleaseComObject(_objAppln);
_objWorkSheet = null; _objWorkBooks = null; _objWorkBooks = null; _objAppln = null;
}
private void button1_Click(object sender, EventArgs e)
{
string cell1 = string.Empty, cell2 = string.Empty;
string[] chars = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T" };
for (int row = 1; row < 1000; row++)
{
for (int column = 0; column < 20; column++)
{
cell1 = chars[column] + row.ToString();
Range objRange = _objWorkSheet.get_Range(cell1, cell1);
objRange.Value2 = cell1;
System.Runtime.InteropServices.Marshal.ReleaseComObject(objRange);
objRange = null;
}
}
SaveExcel();
}
}
}
Project will need a reference of Microsoft.Office.Interop.Excel.dll
While button1_Click is processing, at that time if you open any other excel and just click on cells... it throws error.
Gurpreet
|
|
|
|
|
i want to turn y usb into a smart drive, however the u3 website seems to be unavailable
is there a source code that i can compile to make the u3 converter?
|
|
|
|
|
The site seems to be working for me - clickety[^].
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
I'm cropping an image and after i cropped the image,i want to put the image in a container as thumbnail...can anyone help me...how can i refresh the directory / folder where the image i cropped was save...thanks in advance guys...
|
|
|
|
|
So with a history of 28 prior messages, all well formed with sensible titles you post this. So... irritating.
Define what you mean by refresh the folder. Presumably you can just reread the files in the folder into your container or are you talking about the ms thumbnail.db
There are a number of articles around for manipulating this object have some google fu[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I'm not sure how refreshing the folder is going to help, but to create a thumbnail image follow this link[^]. Apparently, there's an app for that, built in by Microsoft.
BTW - if you really, really want to have your post ignored or ridiculed, just add "Urgent" to the request. It's guaranteed to work, almost every time.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
What have you tried so far?
Quidquid latine dictum sit, altum videtur.
Whatever is said in Latin sounds profound.
|
|
|
|
|
I guess that you want to draw a thumbnail in the contrainer.
private void panel1_Paint(object sender, PaintEventArgs e)
{
Graphics gc = e.Graphics;
Pen pen = new Pen(Color.Red, 5);
Image image = global::TestGraphic.Properties.Resources.niang;
gc.DrawImage(image, new Rectangle(400, 20, 300, 300));
}
|
|
|
|
|
Hi , have a good day ,
I build a new Windows C# Application With Visual Studio ...
And when ever I run it , it's try to create connecting with this site ocsp.verising.com ,
I discover this hidden connection by "ESET Smart Security firewall"
I thought may be Microsoft , trying to steal my code , and sell it in the black market ?
---
P.S: I wrote this Application Piece by Piece , and there are Nothing like networks coding ,
or any things related to the internet , or to this site ocsp.verising.com
Thank in advance
I know nothing , I know nothing ...
|
|
|
|
|
Verisign is one of the players in network security.
The OCSP (Online Certificate Status Protocol) is used to secure transactions.
SSL is also used.
Does any of those ring a bell?
My guess is you are using some security component that relies on the above. You should know what you are doing!?
|
|
|
|
|
Thank you for your replay , and No I didn't use any Network Components ,
But is this secure transactions send information from my PC to some site database ?
I think it's YES , cause ( ESET Smart tell its "Out Bound connection" ) !
The Big Question now , is Why ? "Hello , I need some privacy , Here!!! " ...
thank you
I know nothing , I know nothing ...
|
|
|
|
|
you might debug through your code step by step to see when a connection will be opened while your app is running.
otherwise hmm block the connection using your firewall and may the lucky app will crash
greetz
|
|
|
|
|
Did you use any code signing? Or, more likely, a third party component that you're using is signed and it's signature is being verified every time it's used.
No, there's nothing fishy going on. You have nothing to worry about with crap being sent from your machine to Microsoft or anywhere else. No, Microsoft is NOT trying to steal your code, ... just drop all the panic-y conspiricy theory garbage and think the problem through with a clear head.
|
|
|
|
|
You wrote an application from the ground up and you don't understand where it's trying to connect to verisign? How many 3rd party components have you used? And do you understand what they're doing?
|
|
|
|
|
Thank you for your replay , all of you , I appreciated any word you said ...
I notice that I was adding a "Componentfactory.Krypton.dll" reference to my project ,
And when I removed it , it's work like with out any Internet Activity ....
However , I didn't use it in my code ( so I didn't notice it ), ( I was Confused and worried )
Thank you guys , so much ,
I know nothing , I know nothing ...
|
|
|
|
|
When you reference Superman, you can't expect him to sit idle all the time.
|
|
|
|
|
Well...I'm a poor new programmer and I don't know to create a application in C# reagarding a network programming.
So, I need a small aplication about network programming. Any kind of it. May be about administrative tools, file transfer, chat , a client/server application, to view all computers in a network. I found some of it here, on site, but almoust all are demos and I can't really use it.
If anyone have something about this, can send me on e-mail : slash2all@yahoo.com
I really need a application.
Thx a lot !
Good luck everyone and enjoy programming.
|
|
|
|
|
Since there are a tons of "network" access methods, you're going to have to narrow down what you're looking for. Noone is just going to send you a project that does something acrossed a network.
Also, if you want to get flooded with spam, posting your email address in a public message in a public forum is a good way to attract it.
|
|
|
|
|