Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

shankbond

@shankbond
About
Posts
62
Topics
26
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Help in Regular expressions
    S shankbond

    can someone really explain that; I am curious about it.

    Thanks Shankbond

    C# csharp regex help html

  • Help in Regular expressions
    S shankbond

    OriginalGriff wrote:

    particularly with a trigger word such as "html" which appears in every web page...

    Yes You are absolutly right. I did that with the help of a javascript.

    Thanks Shankbond

    C# csharp regex help html

  • Help in Regular expressions
    S shankbond

    Thanks but I already have one :), my query is solved now I got the solution by using

    (?<=\\d+(\\.\\d*)?|\\b)html(?=\\d+(\\.\\d*)?|\\b)

    but I am having a new query now? (?:.....) is also a non capturing group so I can theoretically use it in place of look ahead and look behind but that does not work here? any solutions?

    Thanks Shankbond

    C# csharp regex help html

  • Help in Regular expressions
    S shankbond

    Hi, I tried looking this stuff, but may be I did something wrong with match-don't capture. 1) I want the regex to match --> html56 but capture only html also 2) match 45html but capture only html, 3) and don't match or capture at all abchtmldef (not surrounded by alphabets one word only) 4) match html I used \b(?:\d*)html(?:\d*)\b It would be nice if someone can help.

    Thanks Shankbond

    C# csharp regex help html

  • Help in Regular expressions
    S shankbond

    Hi, I am new to regular expressions, I am having a problem regarding matching a specific keyword in certain condition.

    string regexstring="\\bhtml\\b|[.]net\\b";
    Regex rgx = new Regex(regexstring, RegexOptions.IgnoreCase);
    MatchCollection matcol = null;
    string st_data = "I am a .net developer, but also know about asp.net, vb.net ; I work on c#/asp.net platform. I also know dhtml, html4.0, html/xml etc etc.";
    //I want the regex to capture all occureneces for html where html is a word seperated \b-->word boundary or is surrounded by decimals like html4.0 above.
    st_data = System.Web.HttpUtility.HtmlDecode(Regex.Replace(st_data, @"<(.|\n)*?>", string.Empty));
    matcol = rgx.Matches(st_data);

            foreach (Match mat in matcol)
            {
                //I WILL GET the mat.value here.
            }
    

    I tried various variations but of no use. I want to match html4.0 but some how I need only html out of it.kind of substringed match. I hope You understand my point. Please help any help shall be appreciated.

    Thanks Shankbond

    C# csharp regex help html

  • problem with uploading/downloading .docx file
    S shankbond

    Hi,

    hspc wrote:

    I think you need to clear the response using Response.Clear()

    I did but it does no effect on the size.

    Thanks Shankbond

    ASP.NET csharp com help question

  • problem with uploading/downloading .docx file
    S shankbond

    Hi, I have a problem similar to this post: http://www.microsoft.com.nsatc.net/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.office.developer.vba&tid=6fc07fd9-3313-4c09-9457-f6971ecafda4&cat=en_US_9477b478-d551-48fe-b931-e0d7ed05ac44&lang=en&cr=US&sloc=&p=1 In this post the original poster has written his code in VB whereas I have written my code in C# My code for uploading a file:

    protected void Button1_Click(object sender, EventArgs e)
    {
    if (FileUpload1.PostedFile.ContentLength>0)
    {
    string filename = Path.GetFileName(FileUpload1.PostedFile.FileName);
    string storagepath = "D:\\Test\\" + filename;
    int contentLen = FileUpload1.PostedFile.ContentLength;
    Byte[] data = new Byte[contentLen];
    FileUpload1.PostedFile.InputStream.Read(data, 0, contentLen);
    savefiletodatabase(data);
    FileUpload1.SaveAs(storagepath);
    }
    }

    private void savefiletodatabase(byte[] data)
    {
    SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
    try
    {
    SqlCommand command = new SqlCommand("INSERT into dbo.test ([file], [filename], [path]) VALUES (@data, '" + FileName + "', '" + FilePath + "')", connection);
    command.Parameters.AddWithValue("data", data);
    connection.Open();
    command.Connection = connection;
    command.ExecuteNonQuery();
    }
    catch (Exception ex)
    {
    throw ex;
    }
    finally { connection.Close(); }
    }

    The code to retrieve file goes here:

    protected void LinkButton1_Click(object sender, EventArgs e)
    {
    getfile();
    }

    private void getfile() 
    {
        SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings\["ConnectionString"\].ToString());
        try
        {
            SqlCommand command = new SqlCommand("Select \[file\] FROM dbo.test where id='" + Id + "'", connection);
            SqlDataReader reader;
            connection.Open();
            command.Connection = conn
    
    ASP.NET csharp com help question

  • Strange Problem with webservice
    S shankbond

    problem is solved now it was a javascript issue, but it was not caught in webdevelopment server.:confused:

    Thanks Shankbond

    ASP.NET help sysadmin windows-admin

  • Strange Problem with webservice
    S shankbond

    I cannot actually post the code its huge, I will simply explain, The webservice accepts a dataset which has all the information related to sending emails, I have sent emails through this webservice in the past also, but then it used to work fine. Is their something I should check regarding disco, wsdl or other files related to webservice. Please help!

    Thanks Shankbond

    ASP.NET help sysadmin windows-admin

  • Strange Problem with webservice
    S shankbond

    Hi, I am facing a strange problem here, I am using a webservice to send emails through my website. Strangly when I run the application through VS2008 web development server only one email is sent which is normal, but when I publish the website on IIS then two copies of the emails are sent to the sender, which I don't understand. Any suggestions or help shall be appreciated!

    Thanks Shankbond

    ASP.NET help sysadmin windows-admin

  • jumping to the breakpoint inserted in the webservice
    S shankbond

    OH! thanks, One more thing: I have a website running on production server when I connect through my LAN to that server do I need to have User Id and Password for that system to connect to it, and through which port I will be connecting to it so that I can create an exception on firewall. Please reply

    Thanks Shankbond

    ASP.NET debugging question

  • jumping to the breakpoint inserted in the webservice
    S shankbond

    Hi Abhijit, The first article describes about the IIS beautifully but I have a problem here, You said that I can see the w3wp.exe running on my task manager but I cannot see this what does this mean?; On the other hand I have hosted my webservice on the IIS which is running beautifully? Please explain

    Thanks Shankbond

    ASP.NET debugging question

  • jumping to the breakpoint inserted in the webservice
    S shankbond

    Hi, I am using a webservice on my main website I want to debug the given webservice with particular input parameters. Is it possible to debug a webservice by placing breakpoints so that the user can directly jump to the webservice when it is called? I hope You are getting my point.

    Thanks Shankbond

    ASP.NET debugging question

  • Setting active link bold in html
    S shankbond

    Don't know but not working on my end? Any suggestions

    Thanks Shankbond

    ASP.NET html

  • Setting active link bold in html
    S shankbond

    Hi, I have a code here which makes the active links bold in IE7 Is there some work around to make it work in mozilla and higher versions of IE a:active{font-weight:bold}

    Thanks Shankbond

    ASP.NET html

  • sending mails through webservices
    S shankbond

    is there a way that I can add to Your reputation :) :)

    Thanks Shankbond

    ASP.NET help question

  • Screen resolution
    S shankbond

    Hi, Is there some way by which a web application design view should remain the same even if the resolution of the screen is changed? Please reply

    Thanks Shankbond

    ASP.NET design question

  • sending mails through webservices
    S shankbond

    Cool it worked thanks. I need the asynchronous mode only one problem left now how to pop up a message box or so, when the user is simply surfing on some other page?

    Thanks Shankbond

    ASP.NET help question

  • sending mails through webservices
    S shankbond

    Hi, here is the code:

    protected void Button4_Click(object sender, EventArgs e)
    {
    testingservice service = new testingservice();
    AsyncCallback callback = new AsyncCallback(hello);
    service.BeginSendMailGmail1(TextBoxto.Text.ToString(), TextBoxcc.Text.ToString(), TextBoxbcc.Text.ToString(), TextBoxbody.Text.ToString(), TextBoxsubject.Text.ToString(), TextBoxusername.Text.ToString(), TextBoxpassword.Text.ToString(), TextBoxserver.Text.ToString(), TextBoxport.Text.ToString(), TextBoxdisplayname.Text.ToString(),callback,sender);
    Response.Redirect("default4.aspx");
    }

    here is the other method but it will always be completed =true

    void hello(IAsyncResult result)
    {
    if (!result.IsCompleted)
    {
    Response.Write("failed");
    }
    }

    the code for webservice:

    [WebMethod]

    public string  SendMailGmail1(string To, string Cc, string Bcc, string body,string subject, string user\_name, string password, string server\_name, string portnumber, string display\_name)
    {
       
        SmtpClient client = new SmtpClient();
        MailMessage message = new MailMessage();
        client.Port = Convert.ToInt32(portnumber);
        client.Host = server\_name;
        client.UseDefaultCredentials = true;
        client.Credentials = new System.Net.NetworkCredential(user\_name, password);
        client.EnableSsl = true;
        try
        {
            message = new MailMessage(new MailAddress(user\_name, display\_name), new MailAddress(To));
            if (Cc != "")
            {
                string\[\] array1 = Cc.Split(',');
                for (int i = 0; i < array1.Length; i++)
                {
                    message.CC.Add(array1\[i\].ToString());
                }
    
            }
            if (Bcc != "")
            {
                string\[\] array2 = Bcc.Split(',');
                for (int i = 0; i < array2.Length; i++)
                {
                    message.Bcc.Add(array2\[i\].ToString());
                }
    
            }
    
            message.Body = body;
            message.Subject = subject;
            message.IsBodyHtml = true;
            client.Send(message);
            message.Dispose();
            return "sent successfully";
            
        }
        catch (Exception ex)
        {
            return ex.Message.ToString() + "----" + ex.InnerException.ToString();
        }
    }
    

    Thanks Shan

    ASP.NET help question

  • sending mails through webservices
    S shankbond

    Hi, Your method is very simple but when I tried to send the mail using webservice I tried like: testingservice service=new testingservice; string message=service.send mail(,,,.....parameters); where as I have declared the web service as [WebMethod] Public string SendMail(,,,.....parameters) { try { return "mail sent"; } Catch(Exception ie) { return ie.Message; } } I get an error and the application fails to rebuild Cannot implicitly convert type 'System.IAsyncResult' to 'string' Please reply

    Thanks Shankbond

    ASP.NET help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups