|
A suggestion is to create a windows service. Doing so, you decide (service properties / LogOn tab) under which logon the service is running. Then build an ASP.NET page which awakes the service on demand.
|
|
|
|
|
Agree..
This was what i was thiking avbout, BUT, i have one concerne, witch is that the problem is not my code but BulletProf FTP server. The reason is that in the middle of my frustration a system SP in SQL Server came in mind: xp_cmdshell, witch allows
you to execute shellcommands on the server. I created a .BAT script rebooting the server. If i double clicked the .bat file, it rebootet my FTP server, but, if i simply typed "EXEC xp_cmdshell 'c:\myscript.bat'" nothing happened. This is realy strange!
I have never written any windows services, but i was thinking that this might be the solution. Once i have the service up and running, i can set permissions to the service, and access it trough ASP.NET?
Am i the only one experiencing these problems executing .exe files on the server..?
Tnx for the help so far..
PS! Other suggestions on how to reboot my FTP server is greatly appreachiated.
(Sorry my bad english, my head is getting tired, and my mother thounge is Norwegian..)
-Jonas
|
|
|
|
|
LogonAsUser maybe?
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
Not sure if the WINAPI methods are the key. Since, the CreateProcess... methods worked just fine in a console app, but in a asp.net app, it simply wouldn't execute correctly. I did manage to execute the command as Administrator (according to the Task Manager) but, it didnt work... Anyone know if Bulletproof FTP Server have any issues like this?
Jonas
|
|
|
|
|
BulletProof FTP server have some inbuilt events. I use the OnHour event to execute a .bat file reloading the ini file.
But, i still would like to know how to achive this codewice....
Tnx for the help.
|
|
|
|
|
Hello again,
does anyone know how I would save a file using this path "%userprofile%" I've tried numerous ways but can't do it. I'm trying to save a file in a users home directory on Windows 2000
Thanks again.
- monrobot13
|
|
|
|
|
String szuserprofilevar = "%userprofile%";
String szuserprofile = Environment.ExpandEnvironmentVariables(szuserprofilevar);
|
|
|
|
|
Thanks for the help.
- monrobot13
|
|
|
|
|
i need a webpage show source code to draw element model (artifacts) like Rose or Visio adn by C#. Please give me.
Thanks
|
|
|
|
|
A full fledged Windows Form app can run inside IE6, inside a web page. Now you need to find (or better, write it on your own) a Windows Forms which does draws object models. My suggestion is to look around gotdotnet.com samples, sourceforge,....
|
|
|
|
|
I need to change the local IP and local computer name in my C# app. I can set the IP using the ManagementObject, but I have not found a way to change the computer name.
-- Kevin
|
|
|
|
|
Hi All,
I'm having a problem that I hope will be simple to solve. I have a RichTextBox that I don't want to format text. By this I mean if I copy a piece of text that is say bold and italic when I paste it into the RTB I don't want it to have those characteristics (unless the Font specified for the RTB has them). For an example lets say that font in my RTB is 8pt and I copy something that is 14pt when it's pasted it gets pasted at 14pt, I don't want that. Is there any way to get around this?
Thanks
- monrobot13
|
|
|
|
|
Figured it out. Just had to use a plain text (DataFormats.Text) format in the Paste method.
Thanks
- monrobot13
|
|
|
|
|
I have a DataGrid in my windows app. One of the fields is a date time type. It's showing up at a date in my DataGrid. I really need to see the time too. How can I change the format of this one field in the DataGrid?
|
|
|
|
|
To change the format of a column, you need to set the Format property of the DataGridTextBoxColumn corresponding to the column. See the example code under DataGridTextBoxColumn should help.
Burt Harris
|
|
|
|
|
Thanks you for your reply.
In my application I'm trying to display records in a table that let me know that some services I have written are working. At this point I'm updating the display on a button click. I tried to apply the code I found in the example you pointed me to. You can see the error message from my exception trap. Can you tell me where I when wrong?
private void m_btnUpdate_Click(object sender, System.EventArgs e)
{
this.sqlDataAdapter1.Fill(this.imAliveDataSet1,0,0,"ImAlive");
// Gets the DataGridTextBoxColumn from the DataGrid control.
DataGridTextBoxColumn myTextBoxColumn;
myTextBoxColumn = null;
// Assumes the Time column is a DataGridTextBoxColumn.
try
{
myTextBoxColumn = (DataGridTextBoxColumn)dataGrid1.
TableStyles["ImAlive"].GridColumnStyles["Time"];
}
catch (Exception excpt)
{
string strMsg = string.Format("{0} Exception caught.", excpt);
}
// Gets the DataGridTextBox for the column.
DataGridTextBox myGridTextBox;
myGridTextBox = (DataGridTextBox) myTextBoxColumn.TextBox;
strMsg "System.NullReferenceException: Object reference not set to an instance of an object.
at FordMon.Form1.m_btnUpdate_Click(Object sender, EventArgs e) in c:\source\ford\fordmon\fordmon\form1.cs:line 227 Exception caught." string
|
|
|
|
|
Is there an method or a way of preforming a SQL SELECT statement on a DataTable so that it returns a array of Rows?
The DataTable.Select() method won't do the job as my query is a bit too complex for me to use it.
This is my SQL query:
SELECT COUNTY_ID , NAME
FROM TOWNS
WHERE NAME IN
( SELECT NAME FROM TOWNS
GROUP BY NAME HAVING COUNT(*) > 1);
Do I need to use a SQLDataAdapter or something? Just a guideline on how I should go about doing this would be helpful.
Thanks
|
|
|
|
|
While a data set has some of the features of a relational database, it's not got a full SQL interpreter, so DataTable.Select won't do what you're looking for. If your data is in SQL database, you can issue the query with a SQLDataAdapter as you suggest.
Hope that helps.
Burt Harris
|
|
|
|
|
Hi,
I was wondering if it is possible to program a low level network application in .net. I mean I want to choose the network interface that handles the packets sent from my app, I want to get every IP packet that passes thru my computer, and so on...
Can anyone give me any pointers?
Thanks a lot,
Andrei Matei
andreimatei@home.ro
|
|
|
|
|
How can I to determine when socket connected to my TcpClient is close connection?
I do this...
IPAddress ipAddress = Dns.Resolve(Dns.GetHostName()).AddressList[0];<br />
TCPListiner = new TcpListener(ipAddress,PortNumber); <br />
TCPListiner.Start();<br />
<br />
while(true)<br />
{<br />
if (TCPListiner.Pending()) <br />
{<br />
TcpClient TCPClient = TCPListiner.AcceptTcpClient();<br />
NetworkStream LNS = TCPClient.GetStream();<br />
}<br />
}
then I send some text throw NetworkStream LNS. Client can close connection. And result this....
System.IO.IOException: Unable to write data to the transport connection. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, So
cketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32
size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32
size)
|
|
|
|
|
Hi All!!
i want to to create crystal report at run time and set all its properties like texts,sections etc. but i am not getting the way to get in. it has many classes like
ReportObject
ReportClass
ReportDefinition
ReportDocumnet
but this is confusting that how to take start...
i want to do like this (this is just assumption)
CrystalReport report = new CrystalReport();<br />
Section section = new Section();<br />
report.Secctions.Add(section);
can anyone help??
sorry for my bad English.
|
|
|
|
|
Hi, I have a problem with drag and drop: every sample about it i have found shows only how to drag a text from a textbox to another or a listview/treeview item to another. Instead, I have some controls (some shapes) and i need to allow to the user to drag them over the form like the visual studio IDE, with the resizing handles, the drawing of the dragged control's border, etc... exactly how the IDE! Can anyone help me, showing some samples (in vb.net or c#)?
|
|
|
|
|
May be a good starting point[^].
|
|
|
|
|
Ok, so I have this app that you fill in your subject and then the message and then it formats it in the particular way i told it to, onto my webserver as a .xml file....
XmlTextWriter writer = new XmlTextWriter("poofacedjohn.xml", null);
But, what I need is for the name of the xml file not to be poofacedjohn.xml, but rather the year, month, day, hour, and minute of the local machine...
like.....
20030426_1718.xml
2003 04 26 17 18
|year||month||day|_|hour||minute|
how would I acheive this...? I can do it in asp.net, but it's not working for me as just a regular windows app.
/\ |_ E X E GG
|
|
|
|
|
String szfilename = System.DateTime.Now.ToString("yyyyMMdd_HHmm") + ".xml";
|
|
|
|