|
AFAIK, Directory.GetFiles() only supports the file:// protocol.
/ravi
|
|
|
|
|
System.IO is managing local resources. Check out the System.Web or System.Net namespaces.
|
|
|
|
|
Hi all,
Please help to solve the below problem.
I am having a string as below. From that how to replace the line break to HTML break tag
<body>
This is line one
This is line two after the line break
</body>
In the above i have to replace the space between the two lines using HTML break tag <br/>
Thanks in advance
Know is Drop, Unknown is Ocean
|
|
|
|
|
You could use regular expressions for that.
Something like that:
Regex regex = new Regex(@"^\r\n", RegexOptions.Multiline);
html = regex.Replace(html, @"<br/>");
replaces all the carriage return and newline groups with <br/> from the beginning of a line.
|
|
|
|
|
While the string is in memory it'll likely contain only the '\n', not the '\r'.
|
|
|
|
|
Nope, it contains the carriage return and the newline also.
|
|
|
|
|
Thankyou very much
it's working good
Know is Drop, Unknown is Ocean
|
|
|
|
|
I wonder if Filesystemwatcher class can handle deletion of more than 3 file objectcs at once (e.g. multiple selection in windows explorer)
|
|
|
|
|
Why don't you try it yourself?
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
So did I I've tried msdn sample-based code and have been loosing updates when creating or deleting more than two files at once
Internalbuffersize property had been set to 32 or 64K
handling code was reduced to incremental(nadd++, ndel++) operatation never the less the variable value was not equal to number of files processed.
|
|
|
|
|
when i run my windows application project using visual studio, everything looks fine. However when i execute the file in my release folder, everything thing looks like in the classic theme instead of the Window XP theme
Can anyone help?
|
|
|
|
|
nevermind, found the cause of the problem
|
|
|
|
|
i just want to make a web application that make mobile skin
like ((www.ownskin.com))
and iwant any one to help me o how can i make it or if there are any i can get help?
|
|
|
|
|
hi.. why when i drag out a listview in vs 2005.
i cant get teh function of listview.selectedindex ?
only selecteditem ..
i want to get the id of the data selected ..
|
|
|
|
|
You have SelectedItems and SelectedIndices - check the Count property of either one of these to make sure there is at least one item selected and if you're just wanting the first item selected then something like this:
int firstSelectedIndex1 = listView1.SelectedItems[0].Index;
int firstSelectedIndex2 = listView1.SelectedIndices[0];
Dave
|
|
|
|
|
hi.. sorry.. i think i would like to use up the DataGridView called dvCustomer
under
private void dvCustomer_SelectionChanged(object sender, EventArgs e)
{
}
when i click on the datagridview row... i would like to get the user ID from database. so that i can do the update as below ..
private void cust_update_Click(object sender, EventArgs e)
{
bool success;
success = dataAccess.AddCustomer(<big>Datagridview ID</big>, cust_name.Text, cust_add.Text, cust_account.Text, cust_phone.Text...);
if (success)
{
MessageBox.Show("Data updated!");
}
else
{
MessageBox.Show("Update FAIL!!!");
}
}
in my dataAccess class
public bool AddCustomer(string function, string custName, string custAdd, string custAcc, string custPhone.....)
{
bool success = false;
string query = string.Empty;
try
{
SqlCommand cmd = new SqlCommand();
cmd.Parameters.Add(new SqlParameter("@companyName", custName));
cmd.Parameters.Add(new SqlParameter("@customerAdd", custAdd));
cmd.Parameters.Add(new SqlParameter("@attName", custAdd));
cmd.Parameters.Add(new SqlParameter("@customerAcc", custAcc));
cmd.Parameters.Add(new SqlParameter("@customerPhone", custPhone));
query += "UPDATE CUSTOMER set company_name= @companyName, company_add= @customerAdd, att_name= @attName, account_num= @customerAcc, phone= @customerPhone...........";
query += " where cust_id = <big>??????????</big> ";
cmd.CommandText = query;
if (cn.State == ConnectionState.Closed) cn.Open();
cmd.Connection = cn;
if (cmd.ExecuteNonQuery() > 0)
{
success = true;
return success;
}
|
|
|
|
|
may i know how do i get the ID from the datagridview ?
|
|
|
|
|
You may be better off reposting in a new thread as this is no longer about the listView as suggested by the subject!
I never use the DataGridView myself so can't be of much help.
Dave
|
|
|
|
|
hi,
i can some english. i hope you understand my question.
i was write a windows service with using a timer. my code such as following.
i was install my builded service with installUtil.exe... my windows service running but i can't see messageBox per 5 second.
you can help me.
Best regards.
Tayfun UZUN
Istanbul/Turkey
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.ServiceProcess;
using System.Text;
using System.Windows.Forms;
namespace denemeWindowsService
{
public partial class denemeServis : ServiceBase
{
public denemeServis()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
timer1.Enabled = true;
timer1.Interval = 5000;
}
protected override void OnStop()
{
}
private void timer1_Tick(object sender, EventArgs e)
{
MessageBox.Show("time - " + DateTime.Now.ToShortTimeString());
}
}
}
modified on Saturday, May 24, 2008 8:37 AM
|
|
|
|
|
Services run on different desktop so you won't see a messagebox. You can allow interaction with service but it is not recommended and it isn't supported in Vista.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
I just wanted to know which one I should use. I have looked at the MSDN articles and have only found rigorous descriptions of each one but none of them give comparisons to the others.
p.s. this is my first post, if I have done anything wrong please feel free to tell me.
the code I have is:
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
GC.Collect();
Environment.Exit(0);
}
|
|
|
|
|
|
|
|
I am experimenting mock objects. I use NMock for mocking. I have scenario where some information is coming from a XML file and I am creating my class objects depending on the values given in that file. This file is shared and multiple programmers are allowed change the value. So when I try to write test for this, it worked one day and stopped working next day as the file data got changed.
I am trying to create mock for this, but I am not getting a start. Can anyone help to get started ?
|
|
|
|