|
Thanks
Common sense is admitting there is cause and effect and that you can exert some control over what you understand.
|
|
|
|
|
wouldn't it be easier to:
strName.Replace("\"", "").Split(...)?
|
|
|
|
|
Not if he wants the name to stay whole (which I assume to be the case). That [what Sledge suggests] seems like a bad idea in general.
modified 27-Dec-12 18:37pm.
|
|
|
|
|
Your assumption is correct. Needed the whole name. To get it done, I changed the delimiter in the data from a comma to a tilde. It worked users are happy for the moment.
(Edit) Part of the conversion process is breaking the name apart into first name last name
Common sense is admitting there is cause and effect and that you can exert some control over what you understand.
|
|
|
|
|
I don't get it. You have a string as "Last Name, First Name" and you want Last Name, First Name without the quotes? Then just strip off the quotes. There is no need to use the split function. Since you want to break the name apart, my solution is actually correct. Remove the quotes, then split based on the comma.
|
|
|
|
|
No, that's just one of the fields. Check out some troublesome data:
id,name,location,phone
1,"Smith, John","Anytown, USA",123-4567
2,William "The Refrigerator" Perry,The Gridiron,000-0000
3,Madonna,"Los Feliz, Los Angeles, CA",555-5555
Not to say that the OP has such problems with which to deal, but some do.
modified 27-Dec-12 22:19pm.
|
|
|
|
|
I don't recall seeing that in the original post. I went back and re-read it, and if that is what the OP had intended, its a very poorly worded question . In this case, I'd:
string[] parts = Split(',')
foreach (string in parts)
Replace("\"", "");
Personally, parts 1 and 2 need special comma handling and parts 0 and 3 don't.
If I wanted to get sophisticated, I believe you can use datasets to parse something like that for you, but I'd just do what I said above... split on the commas, strip off the quotes and then process the 4 fields.
|
|
|
|
|
William "The Refrigerator" Perry and Madonna say that's a bad idea.
Without more knowledge of the data, the only proper way to handle this is to split on the delimiters while honoring the quotes.
Replace is rarely an appropriate tool.
|
|
|
|
|
SledgeHammer01 wrote: its a very poorly worded question
Those are some of the lines I've become better at reading between. If it were that simple, the question wouldn't have been asked (by this particular asker).
|
|
|
|
|
Oh, NM... I see his issue now.
|
|
|
|
|
This is actually what I would've done too - it's seems simpler.
But then there are also multiple fields involved.
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:35am.
|
|
|
|
|
Is it possible to debug into C# source code using WinDbg 6.12.0002.633?
I read on the internet that this is not possible with 6.12.0002.633. On 32 bit Win7, I am able to set breakpoint into C# source file, but the breakpoint does not showup in red.
One of the link says that it is possible to debug into C# source code only with WinDbg 6.7.05.0.
I did not download .Net framework source code.
I need to debug on a 64 bit Win 7 OS. Did not try yet on Win 7 64 bit as I was not able to debug into C# code on 32 bit version itself using WinDbg.
Thanks,
Sharath
modified 28-Dec-12 0:43am.
|
|
|
|
|
I hv written following code to show text on tab click in google map now alone with text in pop up window i want to give link as well how to give that?
code is....
GooglePoint GP4= new GooglePoint();
GP4.ID = "4";
GP4.Latitude = 28.496193;
GP4.Longitude = 77.096595;
GP4.InfoHTML = "This is pointing to Building 6 Tower C NIL Labs Ground Floor";
//HtmlAnchor GP5= default(HtmlAnchor);
//GP5.HRef = "http://www.google.com/";
//how to give link to open web page along with " this is pointing to buildin...." text shown in above code.
|
|
|
|
|
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
i want to add link to my tab pop up to open any web page on click of it as i have to use HTMLanchor tag how to use it in following code to give link with text
GooglePoint GP4= new GooglePoint();
GP4.ID = "4";
GP4.Latitude = 28.496193;
GP4.Longitude = 77.096595;
GP4.InfoHTML = "This is pointing to Building 6 Tower C NIL Labs Ground Floor";//here with this tab i want to give a link like "www.google.com",this is aspx.cs page code
//HtmlAnchor GP5= default(HtmlAnchor);
//GP5.HRef = "http://www.nil-labs.com/";
|
|
|
|
|
Is it possible to implement tcp server inside .net web application
|
|
|
|
|
Yes, but why would you want to?
It's better off as it's own seperate application.
|
|
|
|
|
Actually i have devices(client) which communicate through tcp with server(C# desktop app).What i want is to access the server and control the devices(client) through web.
|
|
|
|
|
OK??? You're still going to have to write a seperate server application. It's not a good idea to implement a TCP server inside a web app.
|
|
|
|
|
thanks for the suggestion Dave .
|
|
|
|
|
I suppose you could. Personally, I have not done it. But from what I gather based on the above - it probably would not be beneficial.
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:35am.
|
|
|
|
|
thanks, now i ' m planning to write a separate web app.
|
|
|
|
|
As in below artical i had been try to get info from another computer;
Collecting Remote System Information With WMI[^]
However, i had created class Systeminfo and followed the steps infact i had embed the provided source and run my script but received error (Object reference not set to an instance of an object.)
|
|
|
|
|
Huh, too bad. Sure wish we could see your code so we could help.
|
|
|
|
|
here is my script;
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;
using System.Diagnostics;
using System.Globalization;
namespace Computer_system
{
public partial class Form1 : Form
{
private RemoteSysInformation.SystemInformation sysinfo;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (sysinfo.Get("textBox4.text") != 0)
{
MessageBox.Show("Error getting system information.", "System Information");
}
else
{
textBox3.Text = ("" + Computer_system.win32_computer_system.GetDomain());
textBox2.Text = ("" + Computer_system.win32_computer_system.GetUserName());
textBox1.Text = ("" + Computer_system.win32_computer_system.GetPSComputerName());
textBox5.Text = ("" + Computer_system.win32_computer_system.GetManufacturer());
textBox6.Text = ("" + Computer_system.win32_computer_system.GetModel());
listBox1.Text = ("" + Computer_system.win32_printer.GetName());
}
}
private void button4_Click(object sender, EventArgs e)
{
Process.Start("Cmd.exe", @"/C mstsc.exe /v:");
}
private void button2_Click(object sender, EventArgs e)
{
Process.Start("Cmd.exe", @"/C RC.exe 1");
}
private void button3_Click(object sender, EventArgs e)
{
Process.Start("Cmd.exe", @"/C MSRA.exe /OfferRA");
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
|
|
|
|