2,245 Posted Topics
Re: [QUOTE=oppiet30;900911]I would like to send mail to myself using a for loop. Like I would like to send email to myself 100 times with a bash shell script. I use to have a script that does this, but I seem to have lost it.[/QUOTE] This thread is over four years … | |
Re: I didn't understand it either. Nice to see we have all the same opinion for once on a thread! :) | |
Re: In .NET the char data type is is 16bit, most other languages it is 8bit. You will also need to watch out for that. | |
Re: Are you using an XmlSerializer when this error occurs during runtime, or is this a compile time error? Could you also include the error number. Also check this posting: [url]http://www.dotnetfunda.com/forums/thread146-cs0016-could-not-write-to-output-file-cwindowstemporary-aspn.aspx[/url] | |
Re: You're going to need to post code for this I think. I don't understand enough of the problem to help from what you have posted. | |
Re: The [icode].Refresh()[/icode] only repains regions of the form that have been invalidated. To force a repaint call [icode].Invalidate()[/icode]. You may only want to invalidate the picture box or wherever you are doing the custom painting. [code=c#] private void button1_Click(object sender, EventArgs e) { this.Invalidate(); } [/code] | |
Re: I have implemented the desired behavior in your project. Let me know if this isn't what you were asking. | |
Re: I guess you could use a panel with a lot of buttons so you can get the click appearance minesweeper has and you could switch out button images. I would start with that approach. You're going to want to lay these buttons out with code. Don't use the designer to … | |
Re: To truly pause an upload you should kill the connection. Another method would be to manually control sending the chunks of data and start sending a minimal amount of data so the transfer is not truly pause but is sending enough data to keep the connection alive. This isn't a … | |
Re: You can't very well convert an XML document in to something "human readable" without knowing the structure of the document. Elements could contain any number of child elements, etc etc. XML by itself is fairly readable if you understand you're looking at related data in my opinion. | |
Re: export the variable and use $ENV: [code=bash] sk@sk:~$ export MYDATESTAMP="2009-06-25 21:57:18" sk@sk:~$ perl -MDate::Parse -le'print str2time($ENV{"MYDATESTAMP"});' 1245981438 [/code] | |
Re: Are you trying to get the PC Name or the DNS Hostname of an IP Address? They are two different things and you will only be able to [b]sometimes[/b] get the pc name if they are on your LAN. If you are trying to get the DNS name of the … | |
Re: The order by should appear in the last query of a union but it applies to [b]ALL[/b] data in the union. You will be ordering all of the queries by the same column. If you want to have the union'd queries ordered by the query order then you could: [code=sql] … | |
Re: Create a user defined function to do the value mapping and: [code=sql] Update Table Set Column1 = dbo.GetValue('abc'), Column2=dbo.GetValue('def') [/code] Post your complete query here if that doesn't make sense. | |
Re: use: [code=c#] this.Controls.Find("buttonName", true) [/code] It will search for the named control in child containers. | |
Re: What do you mean by "control the flow"? Typically this is called IPC or Inter-Process Communication when you have two applications communicating. | |
Re: Both the client and server need to be aware of the class definition for the object you will be using. The client and server need to know how to serialize/deserialize the object. You could implement an interface or declare the definitions in a separate DLL and do the business logic … | |
Re: Instead of calling ExecuteScalar you should open a DataReader and populate a DataTable. [code=c#] private void button1_Click(object sender, EventArgs e) { const string connStr = "Data Source=apex2006sql;Initial Catalog=Leather;Integrated Security=True;"; const string query = "Select * From Invoice Where InvNumber = @InvNumber"; using (DataTable dt = new DataTable()) { using (SqlConnection … | |
Re: You can get the dictionaries used in open office: [url]http://lingucomponent.openoffice.org/download_dictionary.html[/url] | |
Re: It would also be handy if you posted the error's you are experiencing in this thread. From the looks of it I agree with ddanbe on what it seems like. I would also recommend to stop prefixing your control names with an underscore. | |
Re: Can you use generics? They are a little easier to deal with than arrays: [code=c#] private void simpleButton2_Click(object sender, EventArgs e) { List<int> free = new List<int>(); List<int> used = new List<int>(); free.AddRange(new int[] { 1, 2, 3, 4, 5, 6 }); used.AddRange(new int[] { 2, 3 }); int nextNumber … | |
Re: Another route is using named pipes if the computers will be on the same LAN. [b]ddanbe[/b]'s suggestion is the most generic and common though, so if you want to play it safe then use tcpip. Named pipes don't play very well on some versions of windows. | |
Re: Use parameterized queries. You will actually be able to read the SQL, prevent SQL injection, and have better performance on the sql server. Here is an example for Sql* but you can change the typename to OleDb and use it the same way: [code=c#] private void simpleButton1_Click(object sender, EventArgs e) … | |
Re: [code=c#] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace daniweb { public partial class frmText : Form { private List<string> _values; public frmText() { InitializeComponent(); _values = new List<string>(); } private void button1_Click(object sender, EventArgs e) { _values.Add(textBox1.Text); textBox1.Clear(); MessageBox.Show(GetLastString()); } … | |
Re: Indy has an SMTP client you can use to send emails. Here is a sample: [code=delphi] function TEmailFm.SendTestEmail(const aString: String): Boolean; Var aMsg: TIdMessage; aFile: String; begin Result := True; aStringList := TStringList.Create; try aMsg := TIdMessage.Create(Self); aMsg.From.Address := Cfg.eSourceEmail; aMsg.Subject := 'Test E-Mail'; aMsg.Recipients.EMailAddresses := aString; aMsg.Body.Text := 'Test … | |
Re: [code=dos] C:\> dir /s >> files.txt C:\> [/code] | |
Re: I'm afraid I don't understand when this condition occurs. Does it happen when you server is coming up for a reboot or when it is going down? Also can you reliably reproduce the worker process consuming 100% cpu? | |
Re: I think this should answer your question: [url]http://www.daniweb.com/forums/thread173903.html[/url] [url]http://support.microsoft.com/kb/329014[/url] | |
Re: If i'm not mistaken one of the parameters to ShellExecute() is the startup path of the process. If this is the only reason for having a shortcut could you not just set the Startup Path with ShellExecute()? I'm not trying to argue or convince you to use another way... I … | |
Re: A simpler way to do that would be to create a public method in the page and pass the data as a parameter. In the master page: [code=c#] void someClickEvent() { if (Page is pgUserInformation) { ((pgUserInformation)Page).PassParameter("abc"); } } [/code] Replace pgUserInformation with the name of the class from the … | |
Re: Try this, unwire all of your existing events and wire up these: [code=c#] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace daniweb { public partial class frmText : Form { public frmText() { InitializeComponent(); textBox1.GotFocus += new EventHandler(textBox1_GotFocus); textBox1.LostFocus += new … | |
Re: You would be best off creating an ASP.NET application and moving your logic to a web project. There are software products out there to get form applications online but they're obviously not native and performance/usability suffers. Is there any reason you don't want to do a web project? | |
Re: Just call .ToString() with the string formatting options you want. I'm guessing you want year.month.day.hour.minute.sec? Use: I have separated the first code line with .'s for readability. [code=c#] DateTime.Now.ToString("yyyy.MM.dd.HH.mm.ss"); DateTime.Now.ToString("yyyyMMddHHmmss"); [/code] | |
Re: [code=vb.net] Public Class FormStart Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim readText() As String = System.IO.File.ReadAllLines("C:\file.txt") Dim s As String For Each s In readText Dim columns() As String = s.Split(New [Char]() {","c}) System.Diagnostics.Debugger.Break() Next End Sub End Class [/code] | |
Re: Which code are you trying to make work -- what you have or what your professor gave you? [code=c#] public sealed class Employeex : ICloneable { public int EmployeeID { get; set; } public string Name { get; set; } public int CurrentLocationID { get; set; } public Employeex() { … | |
Re: You're probably best off creating a dataset and working through that. Add a new DataSet to your project, right click on the dataset designer and add a table adapter, select "New Connection", hit the "Change" button next to the data source text box and select "Microsoft Access Database File (OLE … | |
Re: So this has nothing to do with files? You have a song stored as binary in the SQL Server and want to use MediaPlayer to play the song, but media player is asking for a URI and you only have a memory buffer? Write out a temporary file.. [url]http://silverlight.net/forums/t/94557.aspx[/url] [url]http://www.iis.net/extensions/SmoothStreaming[/url] … | |
Re: 1. [code=bash] #!/bin/bash if [ "$1" = "" ]; then echo "usage: $0 [filename]" exit 1 fi if ! test -f $1 then echo "Invalid file name" exit 1 fi chmod u+x $1 [/code] 2. Put the above code in grant.sh, chmod a+x grant.sh, ./grant.sh 3. You can use 'stat' … | |
Re: [QUOTE=rockhauler;657950]Vista is ok now. When it first came out there were problems. It always happens like that. It will always be like that. It has always been like that. Nothing changes.[/QUOTE] While that is true it does vary on how many problems there are and what type of problems. With … | |
Re: Here is an example of connecting to an SQL Database, executing a query, and loading a DataTable: [code=c#] private void button1_Click(object sender, EventArgs e) { const string connStr = "Data Source=apex2006sql;Initial Catalog=Leather;Integrated Security=True;"; const string query = "Select * From Invoice Where InvNumber = @InvNumber"; using (DataTable dt = new … | |
Re: Looking at the javascript above: This won't detect 4 character TLDs which are valid, such as .mobi or .info: [code] if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) { alert("The address must end in a three-letter domain, or two letter country code.") [/code] Here is the function I use for validation but it is … | |
Re: You need to escape your query and pass the text value of the combo box, not the literal name. You should also use parameterized queries but that is another discussion. I'm assuming since you gave a multi-part exception that this is being raised by the SQL server and not the … | |
Re: Why go through the trouble of using Regex? Let the CLR handle validation for you which will solve your invalid pattern error as well: [code=c#] public static bool IsValidEmailAddr(string email) { try { System.Net.Mail.MailAddress addr = new System.Net.Mail.MailAddress(email); } catch { return false; } return true; } [/code] If this … | |
Re: [QUOTE=adatapost;895972]Here is sql statement: [CODE=VB.NET] Dim sql as String = "select count(*) from tablename" ... [/CODE] It retun zero (0) result when a table is empty.[/QUOTE] Beware -- doing a [icode]Select Count(*)[/icode] from a table locks the entire table and the solution will not scale with multiple users. You will … | |
Re: You obviously will want to make sure the control is found, this code will throw an exception if not. [code=c#] private void button1_Click(object sender, EventArgs e) { for (int i1 = 1; i1 <= 15; i1++) { (this.Controls["textBox" + i1.ToString("F0")] as TextBox).Text = "Hello, world"; } } [/code] | |
Re: What is the error message...? | |
Re: Use the [icode]TreeNode.Tag[/icode] property to store information relating to the tree node. Mock up some container class where you can put file and disk use information and set the node's .Tag property to a reference of it. | |
Re: If a form is shown non-modally using [icode].Show()[/icode] then the CLR will dispose the form if you don't hang on to a reference. Using adatapost's logic should stop the form from being destroyed and you can also located created forms in [icode]Application.OpenForms[/icode] | |
Re: Try this: [code=c#] using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace daniweb.console { class Program { static void Main(string[] args) { bool loggedIn = default(bool); while (!loggedIn) { string userName = GetUserName(); //only returns if successful string password = GetPassword(); loggedIn = ValidPassword(userName, password); if (!loggedIn) { Console.WriteLine("Invalid password"); … |
The End.