منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : كيف نغير قيم بواسطة HtmlAgilityPack
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
مثلا لدي هذا السطر
كود :
<img src="" />
كيف احدث مابين علامتي التنصيص لاضع رابط صورة من كود فيجوال بيسك ؟

نفس السؤال لـ div كيف اسند له نص بالكود

مصدر الصفحة هكذا
كود :
<head>
    <style type="text/css">
        .style1 {
            width: 90%;
            border-style: solid;
            border-width: 1px;
        }
    </style>
</head>
<table align="center" class="style1" dir="rtl">
    <tr>
        <td bgcolor="ActiveBorder" style="text-align: center">
            مثال لتقرير بواسطة تش ام ال</td>
    </tr>
    <tr>
        <td>
            &nbsp;
            <img id="pic" alt="" src="" height="231px" width="231px" />
            </td>
    </tr>
    <tr>
        <td id="aname">
            &nbsp;</td>
    </tr>
    <tr>
        <td id="mo">
            &nbsp;</td>
    </tr>
    <tr>
        <td id="mail">
            &nbsp;</td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td bgcolor="ActiveBorder" style="text-align: center">
            مع تحيات اخيكم سعود</td>
    </tr>
</table>


وهذا كود المحاولة
كود :
Dim html As String = Application.StartupPath & "\aprint.htm"
        Dim hweb As New HtmlAgilityPack.HtmlWeb
        Dim doc As New HtmlAgilityPack.HtmlDocument
        doc.Load(html)
        Dim nod As HtmlAgilityPack.HtmlNode = doc.GetElementbyId("pic")
        Dim src As HtmlAgilityPack.HtmlAttribute = nod.Attributes("src")

        nod.SetAttributeValue(src.Value, "pics/" & picname)
        doc.Save(Application.StartupPath & "\aprint.htm")
ياسلام عرفت للصورة وهي هكذا بعد التعديل
كود :
'احضار ارتباط الصورة لتحديث القيمة
        'Dim nod As HtmlAgilityPack.HtmlNode = doc.GetElementbyId("pic")
        'Dim src As HtmlAgilityPack.HtmlAttribute = nod.Attributes("src")
        'nod.SetAttributeValue("src", "pics/" & picname)

لكن كيف لعناصر الـ td
كيف نحدث المحتوى
كود :
<td id="aname">
            saud</td>